html - Image not taking up full width set on parent div -
see fiddle
as can see in fiddle there empty space on left side of image. have set image 100% width not taking space. can check hover on it.
html
<ul class="ulteamlist"> <li class="teamlist"> <img src="http://s21.postimg.org/jpw2o7ofr/image.png"> <div class="overlay"></div> <p>vikas ghodke</p> <p class="tposition">lead developer</p> </li> </ul>
css
ul.ulteamlist { margin: 0; list-style: none; } li.teamlist { background: #fff; box-shadow: 0px 1px 1px -1px #ccc; float: left; padding:0; display: block; width:40%; margin-bottom: 3%; margin-right: 3%; transition: 0.5s; position: relative; } li.teamlist:hover { background:#0dbca1; } li.teamlist:hover p { color:#fff; } .overlay { width: 100%; height: 210px; background: #fff; position: absolute; top: 0; opacity: 0; transition: 0.5s; } li.teamlist:hover .overlay { opacity: 0.3; } li.teamlist:nth-child(4n+4) { margin-right: 0; } .no-js li.teamlist { display: block; } li.teamlist img { width: 100%; height: 210px; margin:0; } .teamlist p { padding: 10px; color: #5b5b5b; font-weight: 400; font-size: 14px; padding-left: 15px; } p.tposition { font-weight: 300; margin-top: -27px; font-size: 11px; margin-bottom: 0; color: #9d9c9c; text-transform: uppercase; }
extending comments (both mine , op's):
it's not "gap", per say; it's transparent pixel in left of original image:
you can see in this fiddle:
<img src="http://s21.postimg.org/jpw2o7ofr/image.png" />
body { background-color:yellow; } img { outline:1px solid black; }
with placeholder picture set seems fine:
Comments
Post a Comment