首页 > 请教,底部浮动为什么去除不了?还有也不能居中显示!

请教,底部浮动为什么去除不了?还有也不能居中显示!

有人提醒,我改动了一点排版,现在想把<div id=footer>这个块级元素内的文字放入底部居中显示,由于前面的一些效果我是用了float样式。最后在#footer的样式设计里用了clear:both,但没效果而且用了text-align:center 文字也没有居中显示。在HTML里也修改了但是达不到想要的效果。图1,图2是我的效果,图3是想要的效果。

图1

图2

图3
html文件
<html xmlns="http://www.w3.org/1999/xhtml&...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>自己设置的第一个页面</title>
<link href="StyleSheet2.css" type="text/css" rel="stylesheet" />

</head>
<body>

<div id="container">
    <div id="header"></div>
   <div id="=footer">
        <p class="content">
            <a href="#" target="_blank">首页</a>
            <a href="#" target="_blank">网站</a>
            <a href="#" target="_blank">文章</a>
            <a href="#" target="_blank">作者</a>
            <a class="last" href="#" target="_blank">投递</a>
        </p>
        <p>
            Copyright (C) 2016 || <a href="http://www.google.com" target="_blank">谷歌学术</a>
        </p>
    </div>

</加粗文字div>
</body>
</html>

Css文件代码

......此处省略

footer p.content{

background-color: blue;
clear: both;
text-align: center;

}

footer p{

 background-color: blue;
clear: both;
text-align: center;

}

footer p a.last {

margin:0;

}


这么多的代码,而且排版还有问题。。。我建议你先把代码放在jsbin等类似的网站上,然后贴出链接来会更友好些 :D


别放没用的代码,放你有问题的一段,并且自己说一下做过什么尝试

提问前去看一下“提问的艺术”


其他先不管,我帮你看了一下,
<div id="=footer">这个明显错了,应该是<div id="footer">
然后css的话footer p.content,footer前面少了#,
clear:both的话,#footer{clear:both};
对了,footer下面的a记得设置白色字体。

【热门文章】
【热门文章】