Forum Moderators: not2easy
I need to apply the style
overflow: auto;
width:75%;
to every paragraph inside a "resize" div. I cannot apply this to the <p> tags manually because the code is user generated and there is no simple way of doing it.
Can anybody help me out with this? I need something like div.resize.p, but that obviously won't work. Any help appreciated.
Thanks,
Ryan
Basically, whenever you find the need to keep repeating a class name, then move the class name to the parent element and use the above notation with a space to "reach in" and style the named child elements.
Literally minutes ago I just added this to a stylesheet:
div.toolslist hr {clear: both;}
div.toolslist div {clear: both; margin: 2px;}
div.toolslist div h3 {font-size: 110%; margin: 3px; float: left;}
div.toolslist div p {font-size: 90%; margin: 4px; float: left;}
div.toolslist div a {font-size: 90%; margin: 4px; float: right;}
div.toolslist>div>p
vs.
div.toolslist div p
the second will also match the divititis suffering
<div class="toolslist>
<div>
<div>
<div>
<p>this</p>
</div>
</div>
</div>
</div>
Knowing your selectors is important
[w3.org...] has a nice overview, just need to get rid of IE6 before we can use it all.