Log in

View Full Version : Does nested CSS exist?



thenextbesthang
11-09-2006, 05:58 PM
Basically what I want to do is to make the top 20% of the screen orange, and make sure that some text always stays in that orange box.

Would the synax be sumthin like this



.divtop
{
width: 100%;
height: 25%;
border-color: black;
border-style: solid;
border-top-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
border-bottom-width: 0px;
background: orange;
.texttop
{
text-align: center;
text-size: 30px;
}
}

<div class = "divtop">
<p class = "texttop"> Some Text Here </p>
</div>

ItsMeOnly
11-09-2006, 06:16 PM
.divtop .texttop {
text-align: center;
text-size: 30px;
}

Twey
11-09-2006, 06:34 PM
text-size isn't a property. You probably mean font-size, but beware using absolute units for font sizes! It causes your font to be (technically, although most browsers [IE excepted] will allow it anyway) impossible to resize, and thus cause problems to both visually-impaired users and users with an unusual monitor size or resolution: 30px in 1600&#215;1200, for example, is considerably smaller in real-life terms than 30px in 640&#215;480 on the same monitor.