Custom Search
|
|
How To Create Vertical Spacing Between Lists Using Html Li Tag & Css
list item 1 list item 2 item 2 sub-list 1 item 2 sub-list 2 List item 3 The above HTML code is rendered in Mozilla browser (i.e. Firefox 3.x and greater), IE 7.x and greater and Safari 3.2 and greater on my Vista Home Premium as follows;however, please note the html tags that are surrounding the inner tags. This is required for W3C strict validation;otherwise, you'll receive errors. list item 1 list item 2 item 2 sub-list 1 item 2 sub-list 2 List item 3 The above UL and LI tags format as expected. The only bug I encounterd was with Internet Explorer 7.x and greater is the second UL tag didn't properly have the vertical spacing. So to resolve this bug in IE simply add margin-top to the second UL tag as so: list item 1 list item 2 item 2 sub-list 1 item 2 sub-list 2 List item 3 Oddly enough, there was no extra spacing with Firefox 3.x and greater and Safari 3.2 and greater with this last bit of code. In other words, margin-top:10px didn't have any effect with Firefox and Safari. Article Directory: http://www.articledashboard.com CSS Tutorial, tips, guides. Learn CSS programming. Victor Kimura |
|
© 2005-2011 Article Dashboard