gpt4 book ai didi

html - 设置页面换行中的图像放置?

转载 作者:行者123 更新时间:2023-11-28 09:00:15 25 4
gpt4 key购买 nike

我想知道是否有可能以某种方式设置页面换行,以便宽度是图像和文本框如何 float 和左/右/上/下命令的最大限制。下图澄清了我的问题,因为目前我的编码词汇量非常有限:enter image description here

提前致谢!

最佳答案

看这里:

http://jsfiddle.net/gh129L5b/19/

#container {
background-color: gray;
width: 100%;
height: 100%;
}

#wrapper {
width: 80%;
height: 800px;
margin-left: auto;
margin-right: auto;
background-color: white;
max-width: 48em;
}

#red {
height: 100px;
width: 100px;
background-color: red;
float:left;
margin-top: 70%;
}

#blu {
height: 100px;
width: 100px;
background-color: blue;
float:right;
margin-top: 40%;
margin-right: 5%;
}

或者,如果您想使用position 属性而不是float:

http://jsfiddle.net/gh129L5b/28/

#container {
background-color: gray;
width: 100%;
height: 100%;
}

#wrapper {
width: 80%;
height: 800px;
margin-left: auto;
margin-right: auto;
background-color: white;
max-width: 48em;
position: relative;
}

#wrapper > div {
position: absolute;
}

#red {
height: 100px;
width: 100px;
background-color: red;
bottom: 20%;
}

#blu {
height: 100px;
width: 100px;
background-color: blue;
top: 40%;
right: 5%;
}

关于html - 设置页面换行中的图像放置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26951992/

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