简体   繁体   中英

Extra pixels when using w3.css w3-row

The following html

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
</head>
<body class="w3-red">
    <div class="w3-main w3-content w3-padding">
         <div class="w3-row w3-blue">
             <div class="w3-quarter">
                 <img src="http://www.w3schools.com/w3images/girl_mountain.jpg" style="width:100%">
             </div>
             <div class="w3-threequarter">
                 <p>Hello World</p>
             </div>
        </div>
    </div>

</body>
</html>

gives the following result . As you can see there is an extra pixel of padding below the image. Is this by design? An error on my part? A bug? Either way I find it very annoying and would love to know how to get rid of it. Thanks.

Credit here to Mats at bugzilla.

img{margin-bottom:-5px}

should be

img{vertical-align:bottom}

in w3.css

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM