- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
How can I prevent the left padding from being lost in IE7 (IE8 compatibility mode) in the following example once the element jumps to the next line down?
Hi ajcool123,
here i got it and below is the code for it….
Cheers
<style type="text/css">
* {
margin: 0;
padding: 0;
}
iframe {
display: none
}
.wrap {
width: 210px;
}
.box {
float: left;
width: 100%;
}
.elm {
float: left;
background-color: #333;
color: #fff;
line-height: 30px;
font-weight: bold;
padding: 3px 4px;
margin: 2px 2px 2px 0px;
white-space: nowrap;
}
.clear {
display: block;
clear: both;
}
</style>
</head>
<body>
<div class="wrap">
<div class="box">
<a href="#" class="elm">test1</a>
<a href="#" class="elm">test12</a>
<a href="#" class="elm">test123</a>
<a href="#" class="elm">test1234</a>
<a href="#" class="elm">test12345</a>
<a href="#" class="elm">test1</a>
<a href="#" class="elm">test12</a>
<a href="#" class="elm">test123</a>
<a href="#" class="elm">test1234</a>
<a href="#" class="elm">test12345</a>
<a href="#" class="elm">test1</a>
<a href="#" class="elm">test12</a>
<a href="#" class="elm">test123</a>
<a href="#" class="elm">test1234</a>
<a href="#" class="elm">test12345</a>
</div>
<span class="clear"></span>
</div>
</body>
</html>