My recommendation would be to utilize div
elements instead of <ul>
and <li>
tags to avoid having to reset styles on them. This is necessary because certain browsers, like Chrome, automatically add CSS properties such as -webkit-margin-before/after
, which can disrupt your layout.
Here is a helpful Fiddle showcasing the usage of divs
.
If you prefer to maintain your HTML markup, below is a sample:
FIDDLE that functions well in Chrome.
HTML :
<div id='wrapper'>
<ul>
<li><span></span>
</li>
<li><span></span>
</li>
<li><span></span>
</li>
</ul>
</div>
CSS :
html, body {
width:100%;
margin:0;
overflow: hidden;
}
#wrapper {
width: 100%;
height: 220px;
background-color: #000;
}
ul {
-webkit-margin-before: 0;
-webkit-margin-after: 0;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
-webkit-padding-start:0;
}
ul > li {
float:left;
display:block;
width:33.33%;
height: 220px;
list-style-type: none;
}
ul > li > span {
background-color: red;
display:block;
margin:0 auto;
width:200px;
height:100%;
}