html - Divs Images, UL -
so i'm trying ditch tables , @ same time trying not contract divitis, starting simple, need web page has header bar contains menu (horizontal width 100%) title bar contains title (left) , logo (right)
simple enough, in table or beingness in own div in few minutes, don't want create 3 divs (and according "research" shouldn't need to), top menu fine, title bar fine, getting logo align below top menu float right of title text not, i'm trying hard not have multiple divs (or 1 around img logo) looking best way accomplish this.
<body> <div class="dvcontainer"> <ul class="topmenu"> <li>topmenu 1</li> <li>topmenu 2</li> </ul> <ul class="maintitle"> <li>title1</li> <li>title2</li> </ul> <div class="dvlogo"> <img style="border: 0px solid ; width: 72px; height: 72px;" src="images/something.png" alt="ying yang" /> </div> .maintitle ul { padding:10px; margin:0px; float:left; } .maintitle li { list-style-type: none; } .topmenu ul { padding:10px; margin:0px; float:left; } .topmenu li { display:inline; }
your selector not correct. example: ul.maintitle can used select ul tags class maintitle.
so accomplish want using 2 divs, css be:
ul.maintitle { padding:10px; margin:0px; float:left; } .maintitle li { list-style-type: none; } ul.topmenu { padding:10px; margin:0px; clear:both; } .dvlogo{ float:right; } .topmenu li { display:inline; }
html css css3
No comments:
Post a Comment