![]() | |
| ||||
| jobeard can probably give a better answer on this but... If you put it in the CSS file (better option) you would define the link normally. Unless you wanted to get specific. I'll explain near the end. HTML Code: <a href="YOUR LINK">YOUR LINK TEXT</a> The order you define these in is important. If you rearrange them your hover effects may stop working, as they will be overridden. Let's say you only wanted to apply it to your navigation bar. You could use something like: HTML Code: a.nav:link {color: #FF0000; text-decoration: none; }
a.nav:visited {color: #00FF00; text-decoration: none; }
a.nav:hover {color: #FF00FF; text-decoration: underline; }
a.nav:active {color: #0000FF; }
HTML Code: <a class="nav" href="YOUR LINK">YOUR LINK TEXT</a> Quote:
__________________ __________________ Check us out on Facebook!Useful Guides: Networking 101 Security 101 Disable Real Time Monitoring Virus/Malware Preliminary Removal Instructions |
| ||||
| well done ![]() Order is important as noted, but you can still use the < style > ... </ style > anywhere (albeit poor programming 'style' ).There's a performance boost to having external style.css files; the server can load them in parallel to the xxx.html or yyy.php primary file. External files also make the base content more readable via View Source. The HEAD is the ideal location for all CSS stylesheets. [hint: for debugging, I use inline styles in the body until I get what I want and then externalize the sheet and move the include into the head. ] Caution: a:hover was not supported in IE, so use onMouseOver() and onMouseOut() Javascript to do the same thing by changing the class name or directly altering the background or text colors. BD make a point on deciding which object will be effected by what css. Typically, you can use class="name" (which can be applied to multiple objects even of different HTML tags), the id="unique_id" which can only be applied ONCE in the HTML, or a context HTML tag sequence, eg: div table tr td p {something} would only apply to the P inside a CELL. I think that < span ...> visible html </ span> is the ONLY time we wrap CSS around html content.
__________________ J. O. Beard; you + tech-101.com => synergism. Secure your system now |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Copyright © 2009 Tech-101.com. All rights reserved.