takigama@gmail.com schrieb:
Quote:
Hi all,
>
Im relatively new to css, i've used it for very generic stuff, but not
to the extent im using it in my current project. the question i have is
this.
>
Why doesnt this do what i thought it would:
>
css
-----
.pos_table {
border: 0px #ffffff solid
}
>
A.pos_table:link,A.pos_table:active,A.pos_table:vi sited {
font-size: 23px;
}
|
The regulars in this group seem to consider font-size specifications
in pixels BAD. They prefer em or percent sizes.
Quote:
>
A.pos_table:hover {
font-size: 23px;
}
>
TH.pos_table {
font-size: 23px
}
-----
>
html
------
<div class="pos_table">
<table><tr><th>my header</th></tr><tr><td><a
href="somelink>text</a></table>
</div>
>
------
>
i was expecting that the TH.pos_table would make "my header" font size
23... but it doesnt, it reverts to what i've define TH do be, not
TH.pos_table. Instead, i find i have to:
>
...<th class="pos_table">...</th>
>
The same case with the href.. i.e. <a class="pos_table"....>
>
Why? or is this just a case of "your an idiot, you dont define it like
that in the first place anyway". It seems needlessly wastefull to have
to define which class everything inside the div is? What obviously
invalid assumptions have i made about how css works?
>
|
TH is a child of an element whose class is 'pos_table' (namely the
DIV). What you specified in your class selectors are elements of class
'pos_table', whose *parent* is either a link (A) or a table header
(TH). You might want to check your CSS documentation, in particular
the different selectors.
In addition, in CSS not all attributes are propagated to descendants.
Notably, border styles never propagate. In addition, certain browsers
seem(ed?) to have problems applying font attributes defined for the
enclosing element to a table.