gpt4 book ai didi

html - 在ie中居中div

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

我的 div 在 IE 中没有正确居中,但在 Firefox 中工作正常。

我试过关注这个网站:http://flumpcakes.co.uk/css/center-div-ie但是容器 div 出现在 IE 的右侧。

<div id="topbar">
<div id="previous"> &#171; {block:PreviousPage} {/block:PreviousPage} </div>
<div id="next"> {block:NextPage} {/block:NextPage} &#187; </div>
</div>

<div id="container">

<div id="header">

<div id="logo">
Title here please
</div>

<div id="tagline">
So, why do arrays start from zero?
</div>

<div id="topmenu" class="toplinks">
Home <a href="/archive">Archive</a> Ask Me Archive Random
</div>

<div id="search">
<form action="/search" method="get">
<input type="text" name="q" value="" id="" />
</form>
</div>


</div>


<div id="posts-container">

<div id="posts">
Lorem ipsum dolor sit amet, post content goes here
</div>

<div id="leftmenu">
<div id="date" >
23rd November 2010
</div>

<div id="posttitle">
This is a title and it contains all that you may need...
</div>
<i>- Filed under Misc -<i>

</div>

</div>



</div>

CSS:

body
{
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
font-family:Georgia,"Times New Roman",Serif;
font-size: 14px;
text-align:center;
}


#topbar
{
height: 25px;
background: #030303;
min-width: 900px;
width: 100%;
}

#container
{
width: 800px;
margin:0 auto;
text-align:center;
}

#header
{
height: 140px;
width: 800px;
}

#logo
{
font-size: 40px;
font-weight: bold;
margin-left: 0px;
margin-top: 45px;
position: absolute;
}

#tagline
{
font-size: 14px;
font-style: italic;
margin-top: 89px;
padding: 5px;
position: absolute;
}

#topmenu
{
margin-top: 45px;
position: absolute;
text-align: right;
margin-left: 500px;
}

#search
{
margin-top: 62px;
position: absolute;
text-align: right;
margin-left: 570px;
float: right;
}


#next
{
color: #ffffff;
text-align: right;
width: 350px;
padding:3px;
float: right;
}

#previous
{
color: #ffffff;
text-align: left;
width: 350px;
padding:3px;
float: left;
margin-left: 0px;
padding-left: 0px;
}

#posts-container
{
width: 800px;
text-align: center;
}

#posts
{
width: 613px;
margin-left:177px;
position: absolute;
padding-left: 3px;
text-align: left;

}

#leftmenu
{
width:175px;
text-align: right;
margin-left: 0px;
}

#posttitle
{
font-size: 18px;
font-weight: bold;
text-align: right;
padding: 3px;
margin-left: 5px;
}

#date
{
background: #d4ff40;
width: 165px;
height: 14px;
text-align: center;
padding: 4px;
color: #7c9c2d;
margin: 5 auto;
font-size: 11px;
}

最佳答案

只需从 body#container#posts-container 中删除 text-align:center;/p>

关于html - 在ie中居中div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4128550/

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