gpt4 book ai didi

html - div 的定位仅在 Firefox 中发生变化

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

我想要的是:- 在一行文本的末尾放置一个 25px - 25px 的小图像。我正在使用 DIV (re1DOC) 来定位元素以使其更容易一些。问题是:一旦我将它正确定位,它就会像我在 IE 和 Chrome 中想要的那样显示,但是当我切换到 FireFox 时,文本发生了一点移动,div 不再是我想要的位置。- 我已经验证了我的 html 和 CSS 没有任何问题。(我知道我的 CSS 中不需要宽度、高度和背景颜色属性,但它帮助我完成了所有设置,并且在发布之前将被删除。)

HTML:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Restless Earth</title>
<style type="text/css">
body {
margin-left: 0px;
margin-top: 0px;
}
</style>
<link href="CSS/RE.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="REbackground"> </div>
<div id="wordbox"> </div>
<div id="textwrapper">
<p> The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. This shifting process is known as continental drift.</p>
<div id="world"> <img src="images/gcse images/platemovementIMG.gif" width="400" height="210" alt="plate movement"/></div>
<p> The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. </p>

This shifting process is known as continental drift. The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. This shifting process is known as continental drift. The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. This shifting process is known as continental drift. The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.<div id="re1DOC"><a href="documents/gcse/REspec.docx"><img src="images/DOC.png" width="25" height="25" alt="download" /></a>

</div>
</div>

</body>
</html>

CSS:

#REbackground {
height: 100%;
width: 100%;
min-width: 400px;
background-color: #F33;
position: fixed;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
color: #F00;
background-image: url(../images/gcse%20images/eruption1.jpg);
}

#textwrapper {
height: 4000px;
width: 1100px;
position: relative;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
padding-top: 10px;
padding-right: 20px;
padding-bottom: 0px;
padding-left: 20px;
background-color: #00F;
}

#world {
float: left;
position: relative;
padding: 5px;
margin-top: 10px;
margin-left: 10px;
margin-right: 10px;
background-color: #F00;;
width: 400px;
height: 210px;
}

#re1DOC {
position: relative;
left: 400px;
bottom: 50px;
background-color: #0F0;
width:25px;
height: 25px;
}

最佳答案

如果您希望将 25x25 像素的小图像放置在段落的末尾,则不必像以前那样放置它。如果你检查 fiddle @http://jsfiddle.net/8botsnL0/ ,我所做的只是将 < p > 段落标记添加到最后一段(顺便说一句,您还没有这样做),然后在关闭标记 (/p) 之前添加带有 anchor 标记的图像以进行链接。你不需要额外的 div re1DOC。所以你的 html 看起来像,

#REbackground {
height: 100%;
width: 100%;
min-width: 400px;
background-color: red;
position: fixed;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
color: #F00;
/*background-image: url(../images/gcse%20images/eruption1.jpg);*/
}

#textwrapper {
height: 4000px;
width: 1100px;
position: relative;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
padding-top: 10px;
padding-right: 20px;
padding-bottom: 0px;
padding-left: 20px;
background-color: #cecece;
}

#world {
float: left;
position: relative;
padding: 5px;
margin-top: 10px;
margin-left: 10px;
margin-right: 10px;
background-color: #F00;;
width: 400px;
height: 210px;
}
/* remove this not needed as per ur requirement
#re1DOC {
position: relative;
left: 400px;
bottom: 50px;
background-color: #0F0;
width:25px;
height: 25px;
}
*/
<body>
<div id="REbackground"> </div>
<div id="wordbox"> </div>
<div id="textwrapper">
<p> The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. This shifting process is known as continental drift.</p>
<div id="world"> <img src="images/gcse images/platemovementIMG.gif" width="400" height="210" alt="plate movement"/></div>
<p> The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. </p>

<p> This shifting process is known as continental drift. The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. This shifting process is known as continental drift. The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.The position of Earth’s continents has changed over time with some landmasses colliding into one another and others moving apart. This shifting process is known as continental drift. The evidence that supports continental drift includes: the jigsaw-fit of many of the land masses, the geological and fossil finds that are the same in different continents and the scientific measurments taken more recently that prove land masses are moving toward, away and alongside eachother. Continental drift is caused by convectional cell movement in the mantle.<a href="documents/gcse/REspec.docx"><img src="images/DOC.png" width="25" height="25" alt="download" /></a></p>


</div>

</body>

关于html - div 的定位仅在 Firefox 中发生变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26555520/

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