【问题标题】:Making a website, text being moved and ie resizing header制作网站,移动文本并调整标题大小
【发布时间】:2012-09-14 11:38:07
【问题描述】:

图片 -

代码 -

<html>
<header>
<style>
body {
margin: 0px 0px 0px 0px;
    font-family: Arial, Helvetica, sans-serif;
background-image:url('http://www.wallpaperpimper.com/wallpaper/Landscape/Plants/Leaf-In-Front-Of-Blur-1-1600x1200.jpg');
background-attachment: fixed;
background-size:cover;
}
p {
color:#fff;
}
#navi {
position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    height: 25px;
    font-size: 15px;
    width: 100%;
    z-index: 1000;
    background-color:#505050;
    padding-top:3px;
    padding-left:2px;

}
#wrapper {

width:100%;
height:100%;

}
#header {
Width:76%;
height:20%;
background-color:   #303030 ;
margin-top:3%;
margin-left:12%;
background-image:url('http://www.browsewallpapers.com/files/winter-landscape-landscape-7452.jpg');
background-size:cover;
text-align: right;
}
#content {
Width:50.5%;
Height:100%;
background-color:   #303030 ;
margin-left:12%;
margin-top:0.5%;
float:left;
opacity:0.8;

}
#sidecontent {
float:right;
background-color:   #303030 ;
width:25%;
height:40%;
margin-right:12%;
margin-top:0.5%;
opacity:0.8;
}
</style>
</header>
<body>


        <div id="navi">
            <p> HELLO </p>
        </div>

        <div id="wrapper">
            <div id="header">
                <p>Daily call</p>
            </div>
            <div id="content">
                <p> THIS IS DOG</p>
            </div>
            <div id="sidecontent">
                <p>no this is This is patrick</P>
            </div>
        </div>

</body>
</html>

在 Opera、chrome 和 firefox 中一切正常

知道如何解决这个问题吗?

【问题讨论】:

  • 尝试在页面开头添加正确的文档类型。当它应该是一个 标签时,你还有一个
    标签。
  • 感谢标题已在所有浏览器上修复:D 将 doctype 设置为 html5,但现在所有浏览器上的文本正在向下移动

标签: html css firefox google-chrome opera


【解决方案1】:

嗯,你需要重写所有代码:)

如果您想将内容块居中,只需将宽度和边距设置为自动。示例:

.wrapper { width: 900px; margin: 0 auto;}

比放在包装头 div 中,而不是设置标题宽度为 100%。

【讨论】:

    猜你喜欢
    • 2015-06-11
    • 1970-01-01
    • 1970-01-01
    • 2017-12-14
    • 2018-01-03
    • 1970-01-01
    • 2019-02-07
    • 1970-01-01
    相关资源
    最近更新 更多