gpt4 book ai didi

css - 空 div 的高度为 100%

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

是的,我见过很多关于 100% div 的问题。但我仍然无法实现它。因为我在右边的 div 上使用负边距。

测试版在这里:http://bazarak.af/t.php

如果我从螺旋类中删除高度键,则不会出现金属螺旋。请有人帮助我。我只想让螺旋出现在内容旁边。

我可以使用 javascript,但不是每个人都启用了 javascript。

由于我打算在问题解决后删除测试页,所以这里是其他人的代码:

    <!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>TEST</title>

<style type="text/css">
.wrapper{
margin: 0px auto;
background-color: white;
border: 1px solid #CCC;
width: 1030px;
}

body{
background-color: #f3f0e6;
height: 100%;
margin-top: 30px;
}

.content{
float: left;
width: 960px;
padding: 15px;
}

.spiral {
float: right;
margin-right: -32px;

width:63px;
height: 500px;

background-image:url(images/home/spiral.jpeg);
background-repeat:repeat-y;
background-position:top left;
}

.clear{clear: both;}
</style>


</head>
<body>

<div class="wrapper">
<div class="spiral"></div><!-- END SPIRAL -->
<div class="content">

[HEADER]</br></br></br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</br></br></br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</br></br></br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</br></br></br></br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</br></br></br></br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</br></br></br></br> [FOOTER]

</div><!-- END CONTENT -->
<div class="clear"/>
</div><!-- END WRAPPER -->



</body>
</html>

最佳答案

这是基于我的评论的答案。

jsfiddle.net/kxwgJ/1

我只是简单地从螺旋容器中取出“浮子”,然后绝对定位它。由于螺旋只是一种设计,并且它是相对于它的父级定位的,因此绝对定位似乎更有意义,并且您可以避免 float 的一些问题。

关于css - 空 div 的高度为 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10501502/

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