| | |
|
|
|
inline css |
| message from A.H.O. on 23 Jul 2004 |
Ok ok...Ive been looking and looking for the proper way to add css code to a
tag. Or if Im not saying that right...Im trying to change the color of an
individual link on a page using css.
Today Ive learned that its better to imbed css into the ...head(?) instead of
doing inline css... but better yet to link to an external style sheet.
Im going to walk before I run, so to do an inline style to change the color of
a tag...how do I do it? Ive seen it talked about here before but I can't find
the threads.
|
| Mad Dog replied to Mad Dog on 22 Jul 2004 |
A stylesheet only covers what you tell it to cover. If you only have one
pseudoclass link style defined in your stylesheet and you attach it to one
div tag, then only that div tag will be affected. No one says you have to
have a lot of styles defined if you don't want to.
Check out the third page of that tutorial -
http://www.thepattysite.com/linkstyles3.cfm
MD
A.H.O. wrote:
|
| :. Nadia .: replied to Mad Dog on 23 Jul 2004 |
#myDiv { styling goes here}
on your page, you would have a div like so:
<div id="myDiv">
so whenever you change a style within the #myDiv id, the page automagically
updates the styles....
Classes can be used as many times on a page as you want
.myTable
but an id can only be used once per page.
#myDiv
Nadia
"A.H.O." <webforumsuser@macromedia.com> wrote in message
news:cdpqe5$iot$1@forums.macromedia.com...
|
| Michael Fesser replied to Mad Dog on 23 Jul 2004 |
.oO(A.H.O.)
CSS knows different types of selectors to specify to which elements a
declaration should apply.
For direct "access" to an element most times class- and ID-selectors are
used, but there are many other, more elegant selectors:
http://www.w3.org/TR/CSS21/selector.html
There are only very few situation where inline styles make sense. Most
times it's better to store the declarations in an external file (easier
to maintain and saves download time).
Micha
|
|
Archived message: inline css (Macromedia Dreamweaver)