gpt4 book ai didi

CSS - 3 列页面

转载 作者:太空宇宙 更新时间:2023-11-04 05:26:35 24 4
gpt4 key购买 nike

我正在尝试制作 3 列页面,但我遇到了问题。我的 html:

<?php
$this->headMeta()
->setIndent(8)
->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8')
->appendName('keywords', 'story')
;

$this->headTitle()
->setIndent(8)
->setSeparator(' - ')
->headTitle('Your Story')
;

echo $this->doctype();
?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<base href="<?php echo $this->baseUrl(); ?>" />

<link rel="stylesheet" type="text/css"
href="<?php echo $this->baseUrl('/styles/site.css'); ?>" />
<?php
echo "{$this->headMeta()}
{$this->headTitle()}
{$this->headLink()}"
?>
</head>
<body>
<div id="BODY">
<div id="HEADER">
<div id="headerLogin">
<div id="logged-in-as">
<?php echo $this->loggedInAs(); ?>
</div>
</div>
<div id="IMAGE">
<img src="../images/write.png" alt="" height="20%" width="90%" />
</div>
<div id="LOGO">
<img src="../images/logo.png" alt="Your true Story..." height="30%" width="160%"/>
</div>
<div id="USER">
</div>
</div>

<div id="MENU">Menu:
<div id="MENU_IN">
<div id="LIST">
<ul>
<?php
echo $this->menuLinks();
?>
</ul>
</div>
</div>
</div>

<div id="CONTENT">
<img src="../images/ScG.png" alt="" height="10%"/>
<div id="CONTENT_IN">

<?php echo $this->layout()->content ?>
<img src="../images/ScD.png" alt="" height="10%" />
</div>
</div>

<div id="INFORMATIONS">
<?php
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
?>
Your profile:
<div id="INFORMATIONS_IN"
<div id="LIST">
<ul>
<?php
echo $this->usersProfilLinks();
?>
</ul>
</div>
</div>
<?php } ?>
</div>

<div id="FOOT">Iwona Jamroz</div>

</div>
</body>

我的 CSS:

    body
{
background-image: url(../images/back.png);

background-repeat: repeat;
padding-top: 10px;
padding-left: 10px;
padding-right: 10px;
overflow: visible;
height: 100%;

}

#IMAGE {
margin-top: 15px;
margin-left: 8%;
float: left;
}

#LOGO{
margin-top: 5px;
margin-right: 25%;
float: right;
}

#HEADER{
margin-bottom: 15%;
}
#MENU {
width: 20%;
height: 10%;
background-image: url(../images/texMenuBack.png);
margin-right: 5px;
float: left;
}

#MENU_IN
{
margin-top:10%;
height: 10%;
margin-bottom: 5px;
margin-left: 5px;
margin-right: 5px;
background-image: url(../images/texMenuMid.png);
}

#CONTENT{

margin-left: 21%;
margin-right: 21%;
float: left;
}

#CONTENT_IN {
padding-left: 8px;
padding-right: 5px;
padding-top: 5px;
padding-bottom: 5px;

background-image: url(../images/texM.png);
background-repeat: repeat;
min-height: 150px;
}

#INFORMATIONS {
width: 18%;
background-image: url(../images/texMenuBack.png);
margin-left: 5px;
float: right;
}

#INFORMATIONS_IN{
margin-top: 14%;
margin-bottom: 4px;
margin-left: 3px;
margin-right: 3px;
background-image: url(../images/texMenuMid.png);
}

#FOOT {
clear: both;
vertical-align: middle;
}

#headerLogin a{ color: white;
text-align: left;
word-spacing: 3px;
font-family: fantasy;
font-size: 24px;
}
#headerLogin {
color: whitesmoke;
font-family: monospace;
font-size: 24px;
}

#LIST {
}

我有 3 列,但一个接一个,我无法理解,因为我读过做 3 列布局足以用 CSS 编写 float: left, float: left, float: right 但我一直一个接一个不排成一排:/为什么?

看起来像这样:

aaa
.......aaaaaa
...................aaa

最佳答案

float 很棘手,您应该尝试使用不同的浏览器对其进行测试。但是,我确实注意到了这一点

#CONTENT{
margin-left: 21%;
margin-right: 21%;
float: left;
}

尝试删除 margin-left 和 margin-right,因为它可能会导致您描述的效果。

试试这个:

#CONTENT{
width: 20%;
float: left;
}

关于CSS - 3 列页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4832879/

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