gpt4 book ai didi

CSS - 在居中的 div 中左对齐最后一行图像

转载 作者:行者123 更新时间:2023-11-28 02:04:52 26 4
gpt4 key购买 nike

我在一个页面上放置了多行图像。下面的代码执行此操作,如果用户调整浏览器的大小,图像将保持居中。我需要最后一行图像左对齐。我该怎么做?

<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>
#outer
{
width: 100%;
text-align: center;
}
#inner
{
display: inline-block;
}
</style>
</head>
<body>
<br /><br />
<div id="outer">
<div id="inner">
<img id="0" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="1" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="2" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="3" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="4" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="5" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="6" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="7" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="8" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="9" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="10" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="11" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="12" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="13" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="14" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="15" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="16" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="17" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="18" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
<img id="19" src="http://cdn.sstatic.net/stackexchange/img/slider/judaism.stackexchange.com.png" style="height:100px;width:100px;" />
</div>
</div>
</body>
</html>

谢谢,

~M

最佳答案

你可以试试

#12{
float: left;
}

让元素留在左边。

关于CSS - 在居中的 div 中左对齐最后一行图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12119978/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com