简体   繁体   English

浮动:左侧没有给我我想要的正确画廊

[英]Float:left does not give me the correct gallery I want

我想要的网格

Currently trying to build a gallery page for a client's website and I've noticed that a simple float:left does not give me what i'm looking for. 当前正在尝试为客户的网站构建图库页面,我注意到一个简单的float:left并不能满足我的需求。

What I want is for the images to line up perfectly regardless of their size as the images that I have supplied are all in different sizes. 我想要的是无论尺寸大小如何都能使图像完美对齐,因为我提供的图像尺寸都不同。

.gallery img {
    margin:0 !important;
    border:1px solid white;
    width:33%;
    float:left;
}

That's the code that i'm using & the website is responsive. 那就是我正在使用的代码&网站具有响应能力。

use height: auto; 使用height: auto; and max-width: 100%; max-width: 100%;

.gallery img {
    margin:0 !important;
    border:1px solid white;

    height: auto !important;
    max-width: 100%;
    float:left;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想将图像浮动到中心,并具有在它旁边左右书写的能力,但是 float: center 甚至不存在 - I want to float the image into the center with having the ability of writing left and right next to it, but float: center does not even exist 当我第二次启动该功能时,它没有给我想要的结果 - when I start the function for the second time it does not give me the result i want 左浮动的div画廊 - Gallery of divs with float-left float:左悬停效果。 我希望它居中,但是由于float:left,它保持在左边 - float:left hover effect. i want it to be centered but because of the float:left it stays left 我想让我的div漂浮在上一个div的后面 - I want to make my div float left behind the previous div 我想向左浮动第三个子菜单 - I want to float 3rd child menu to left 左右浮动div:我想使其响应速度更快 - Float left & right divs: I want to make it more responsive HTML 图片库浮动左下方 - HTML Image Gallery Float Left Underneath 当我给图像留有边距或向左浮动时,为什么图像变小? - Why do my images get smaller when I give them a margin-left or float them left? 我希望一个文本框向左浮动,另一个文本框向中心浮动,但是两个文本框都具有相同的类 - I want one textbox to float left and other to float center, but both textboxes have same class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM