Css 主页不同于网站上的任何其他页面
可能重复: 为什么我的主页的宽度是1024像素。之后的每一页都有1280像素的宽度?即使是全屏,这也是它的加载方式。为什么 规格:浏览器:位于本地计算机上的Chrome页面Css 主页不同于网站上的任何其他页面,css,html,Css,Html,可能重复: 为什么我的主页的宽度是1024像素。之后的每一页都有1280像素的宽度?即使是全屏,这也是它的加载方式。为什么 规格:浏览器:位于本地计算机上的Chrome页面 root { display: block; } #leftcol a{text-decoration: none;} #leftcol{ left: 10%; width: 200px; height: 100%; margin-top: 0px; position
root {
display: block;
}
#leftcol a{text-decoration: none;}
#leftcol{
left: 10%;
width: 200px;
height: 100%;
margin-top: 0px;
position: absolute;
opacity:0.6;
color: white;
font-size: 2em;
}
#left-placeholder{
height: 100%;
width: 10%;
float: left;
}
#left-pusher{
height: 100%;
width: 200px;
float: left;
}
.left-column-item{
background: url('images/bgnav.jpg');
height: 33.334%;
background-size: 100%;
opacity:0.6;
color: white;
}
.left-column-item:hover{
background: url('images/bgnav.jpg');
height: 33.334%;
background-size: 100%;
opacity: 1;
}
#content{
text-align: center;
color: white;
font-size: 5em;
height: 100%;
width: 70%;
float:left;
}
body{
background: url('images/background.jpg');
background-size: 100%;
margin: 0;
min-height: 100%;
width: 100%}
html, body
{
height: 100%;
}
//html for homepage:
<html>
<head>
<title></title>
<LINK href="styles.css" rel="stylesheet" type="text/css">
<script type ="text/javascript">
</script>
</head>
<body>
<div id ="leftcol">
<a href="content/practice.html"><div class ="left-column-item">Practice!</div></a>
<a href="content/AboutUs.html"><div class ="left-column-item">About Us!</div></a>
<a href="content/contactUs.html"><div class ="left-column-item">Contact Us!</div></a>
</div>
<div id="left-placeholder"></div>
<div id ="left-pusher"></div>
<div id ="content">Math Practice Site<br>Welcome</div>
</body>
</html>
// the practice page that is not loading correctly
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="../styles.css" rel="stylesheet" type="text/css">
<script type ="text/javascript">
</script>
</head>
<body>
<div id ="leftcol">
<a href="practice.html"><div class ="left-column-item">Practice!</div></a>
<a href="aboutUs.html"><div class ="left-column-item">About Us!</div></a>
<a href="contactUs.html"><div class ="left-column-item">Contact Us!</div></a>
</div>
<div id="left-placeholder"></div>
<div id ="left-pusher"></div>
<div id ="content">Math Practice Site <br> hello</div>
</body>
</html>
你的问题很难理解。
不管怎样,试着添加必修课;宽度后:在CSS文件的正文定义中,100%在}之前,快速浏览一下,我认为唯一真正的区别是对CSS页面的引用。页面的其余部分是否应用了正确的CSS,或者CSS作为一个整体是关闭的
如果是后者,请尝试将../替换为完整路径 。。。你们能显示首页的链接吗?不要重复发帖:为什么是root{display:block;}?为什么不使用html{display:block;}?