IE7 Issue with Lists
I've got an issue with IE7. I've got a div titled "imageOptions" with an Unordered List inside it. In FireFox / IE8 etc. It shows the list as an inline 2 x 2 Unordered Lists. But in IE7 it shows it as a long list (4 Items). How do I achieve the IE8 / FireFox look in IE7? Here is my code (HTML First)
<div class="imageOptions">
<?php do { ?>
<ul>
<li>
<a href="#" onclick="MM_swapImage('target','','propertyimages/<?php echo $row_select_property['image_url']; ?&g开发者_运维知识库t;',1)">
<img src="thumbnail.php?image=propertyimages/<?php echo $row_select_property['image_url']; ?>" alt="Small Image 1" class="topImage" onclick="MM_setTextOfLayer('imageText','','<p><?php echo $row_select_property['image_desc']; ?></p>')" /></a>
</li>
<?php } while ($row_select_property = mysql_fetch_assoc($select_property));
</div>
CSS...
.imageOptions {
clear: both;
float: right;
margin: 15px 75px 0;
width: 185px;
}
.imageOptions ul {
list-style: none;
margin: 0;
padding: 0;
}
.imageOptions li {
float: left;
padding: 5px;
}
Thanks in advance.
you dont close off your <ul>
1) Use a CSS reset. The default margin and padding for lists on different browsers vary:
ul, li {
margin:0;
padding:0
}
2) Other than, float:left
put all your styling on the A
tag in the LI
and use display:block
on your A tag so you can make full use of margins and padding.
See my tutorial: I love lists.
You're missing a </ul>
in the HTML.
Move <ul> to before:
<?php do { ?>
精彩评论