I am new to CSS and I am running into this problem with lists in IE8. I am creating an unordered list with several li elements with two divs called left and right.
HTML code -
<ul>
<li>
<div class="left">
<p>ONE</p>
</div>
<div class="right">
<p>TWO</p>
</div>
</li>
<li>
<div class="left">
<p>THREE</p>
</div>
<div class="right">
<p>FOUR</p>
</div>
</li>
</ul>
I essentially want to create a list with two columns. My CSS -
ul {
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul li {
height: 40px;
width: 800px;
border: 1px solid;
}
ul li div.left, div.right {
display: inline-block;
*display: inline;
zoom: 1;
}
Using the above CSS and html, I get a list with two columns with a height a 40px. In firefox and chrome, it shows up just as I wanted, but in IE it is a different story.
In IE, I see the same list but the only problem is spacing. In IE, the divs left and right sit at the top of its parent li whereas in Chrome and Firefox they elements sit in the middle which I is what I want.
How do I get this to happen in IE? In IE, my divs cling to the top of the li element, with no padding in between. Do I need to add something else in my CSS? If anyone can help, it would be great.
Thanks.