html - puting two class divs inside id div -


i managed achieve design want using style of markup, tell me if practice or not, i'm not sure if going deep classes classifies valit, tidy validator tells me ok.

<div id="main">       <div class="submain">          <div class="anothersub">text</div>      </div>  </div> 

and css is

#main { width: 300px;} #main .submain { width: 200px;} #main .submain .anothersub { width: 100px;} 

if looking alternative, think better

#main { width: 300px;} #main .submain { width: 66%;} #main .submain .anothersub { width: 50%;} 

heres fiddle, put background colors can see http://jsfiddle.net/v6ud2/


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -