gpt4 book ai didi

Css 全 Angular 问题

转载 作者:行者123 更新时间:2023-11-28 14:50:12 24 4
gpt4 key购买 nike

我已经为我在 Adob​​e Fireworks Cs5 中构建的页面生成了 css,我想知道如何为我的标题和其他 div 设置完整宽度。我将显示标题部分的 css 代码。

@charset "utf-8";

body {
background-color: #fff;
font-size: 62.5%;
margin: 0;
padding: 0;
}
body * {
font-size: 100%;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
p {
margin-bottom: 1.1em;
margin-top: 0;
}
#main p.lastNode {
margin-bottom: 0;
}
a:link img, a:visited img {
border: none;
}
div.clearFloat {
clear: both;
font-size: 0;
height: 0;
line-height: 0px;
}
li.clearFloat {
clear: both;
}
ul.symbolList {
display: inline;
float: left;
list-style-type: none;
margin: 0;
padding: 0;
}
.AbsWrap {
position: relative;
width: 100%;
}
.rowWrap {
width: 100%;
}
#main {
margin: 0 auto 0 0;
width: 960px;
}
#Div {
position:absolute;
margin-left: 0px;
margin-top: 0px;
display: inline;
float: left;
margin-bottom: 0;
background-color: #333;
width: 960px;
margin-left:-480px;
left:50%;
padding-top: 0px;
height: 849px;
}
html > body #Div {
height: auto;
min-height: 850px;
}
#Div2 {
/* This is the Header*/
margin-left: 0px;
margin-top: 0px;
display: inline;
float: left;
margin-bottom: 0;
background-color: #300;
width: 960px;
padding-top: 0px;
height: 99px;
}
html > body #Div2 {
height: auto;
min-height: 100px;
}

最佳答案

block 级元素,例如 div,如果它们不包含在其他元素中或以其他方式定位,则始终是全宽的。在您的情况下,看起来好像您在没有设置宽度的情况下绝对定位了一些元素。这可能会导致 div 折叠到自身上,除非它有内容。此外,如果您使用百分比来设置宽度,请始终记住它是父项的百分比。父级本身是否设置为任何单位大小?

关于Css 全 Angular 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4716171/

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