gpt4 book ai didi

css - 影响其他div的 float ?

转载 作者:行者123 更新时间:2023-11-28 04:59:45 24 4
gpt4 key购买 nike

我在这里制作了一个网页:http://jsfiddle.net/KM9HJ/

<!DOCTYPE html />
<head>

<title>Home</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />

</head>
<body>

<div id="logo">
<img style="width:50; height:50; float:left;" src="Content/Portal%20Layered.png"/>
<img style="width:50; height:50; position:relative; left:-50px; z-index:2;" src="Content/Blank.png"/>
<div><h2 id="headerh2">Cody Shearer</h2></div>
</div>

<div id="wrapper">

<div style="background-color:#565656">
<div id="links"><a href="Home.htm" class="Home" id="link">HOME</a></div>
<div id="links"><a href="About%20Me.htm" class="AboutMe" id="link">ABOUT ME</a></div>
<div id="links"><a href="Gallery.htm" class="Gallery" id="link">GALLERY</a></div>
</div>
<article id="para">
<p>About This Website</p>
<div id="paraL2"><p>About this page:</p> <div id="paraP">This is</div></div></article>
</div>

</body>

如果您查看显示“关于此页面:”的 div,您会看到它位于 div 的最右侧并且部分被截断(您可能需要调整结果区域的大小才能看到它).我想让文字保持在一行上并向左对齐。据我所知,可以通过从#links 区域中删除“float:left”来解决这个问题,或者通过删除“width: 150px;”可以稍微帮助一下。来自#link。唯一的问题是我花了很长时间试图得到其他的

最佳答案

添加 clear:left 可能对您有所帮助。

#para {
clear:left;
....

关于css - 影响其他div的 float ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17376132/

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