CSS hierarchy and inline style sheets

Submitted by Anonymous (not verified) on Thu, 07/07/2011 - 11:33

I have a problem with inline stylesheets. I like to use inline style sheets instead of using css code in head section of an html page or an external .css file.

Example:

<div style="border: 1px solid red; margin: 20px;"

But I have a problem when I want it to ffect just a part of subelement and not other paralell elements.

Example 2:

<div>
<ul>
<li>
<ul>
...

I want to my third-level "ul" have border but second-level not. I can do it with css code like this:

div ul { border: none; }
div ul li ul { border: 1px solid red; }

How can I do it with inline style without placing it in the third level ul? I want just know if there is a possibility to define hierarchies unter inline stylesheets.

Add new comment