Left floated element and unordered lists (ul).
Posted
by superUntitled
on Stack Overflow
See other posts from Stack Overflow
or by superUntitled
Published on 2010-05-03T16:00:15Z
Indexed on
2010/05/03
16:58 UTC
Read the original article
Hit count: 206
Hello, I am trying to indent the li elements of a ul. There is a left floated div with an image in it. The li element will indent only if I add left padding that is wider than the image itself. I you would like to look at a version irl, take a look. On this page, I have given the li a background color to demonstrate.
<div class="left">
<p ><img src='image.jpg' alt='homepage.jpg' width="360" height="395" /></p>
</div>
<p>
Est tincidunt doming iis nobis nibh. Ullamcorper eorum elit lius me delenit.
</p>
<hr />
<h3>Lorem</h3>
<ul>
<li>list element</li>
<li>list element</li>
<li>list element</li>
</ul>
The css:
.left {float: left; }
.left img {padding-right: 20px;}
ul li { padding-left: 10px; background: blue; }
thanks!
© Stack Overflow or respective owner