[英]Beginner html and CSS. Why doesn't this work?
Check my website at 90.231.109.239 please. 请检查我的网站90.231.109.239。 I cannot get the font to work for my content area. 我无法使字体适合我的内容区域。 The text "Norra Strandv. 10" should be in Courgette but I only get the standard font. 文本“ Norra Strandv。10”应该在小胡瓜中,但是我只得到标准字体。 Could somebody please help ? 有人可以帮忙吗?
here is my index.html < 这是我的index.html <
!DOCTYPE html>
<html>
<head>
<title> Lasses hem </title>
<link rel = "stylesheet" href = "/css/main.css" type = "text/css"/>
</head>
<body>
<div id="page">
<div id="header" class="frame">
<h1> Lasses hem</h1>
</div>
<div id = "menu" class = "frame">
<ul>
<li> <a id="home" href='/index.html'>Home</a> </li>
<li> <a id="away" href='/info.php'>Away</a> </li>
<li> <a id="Temp" href='/temperature.php'>Temp</a> </li>
<li> <a id="Led" href='/controller.php'>Led</a> </li>
</ul>
</ul>
</div>
<div = "content" class ="frame h1">
Norra Strandv. 10
</div>
</div>
</body>
</html>
And here is my css-file 这是我的css文件
@import url(http://fonts.googleapis.com/css?family=The+Girl+Next+Door);
@import url(http://fonts.googleapis.com/css?family=Courgette);
@import url(http://fonts.googleapis.com/css?family=Pacifico);
#page{
width:700px;
margin: auto;
border:solid 1px #CCC;
border-radius:5px;
background-color:#FFF;
}
.frame {
width: 700px;
margin: 0px;
padding: 0px;
background-color: #FFF;
}
.frame h1{
text-align: center;
font-size: 300%;
}
#header {
background-color: #1DB21A;
color: #FFF;
height: 55px;
font-family: 'Courgette', cursive;
}
#menu {
height: 22px;
font-family: Arial, Helvetica, sans-serifs;
background-color: #000;
color: #FFF;
float: left;
}
#menu ul {
list-style-type:none;
margin: 0px;
padding: 0px 50px;
}
#menu li {
display: inline;
float: left;
}
#menu a {
display: block;
width: 60px;
height: 22px;
text-decoration:none;
background-color: #000;
color: #FFF;
}
#menu a:hover{
background-color: #1DB21A;
color: #FFF;
}
#content {
padding: 40px 50px;
width: 600px;
font-family: 'Courgette', cursive;
font-size: 150%;
}
You forgot the id attribute 您忘记了id属性
<div = "content" class ="frame h1">
Change into 变成
<div id="content" class ="frame h1">
Change 更改
<div = "content" class ="frame h1">
Norra Strandv. 10
</div>
to 至
<div id= "content" class ="frame h1">
Norra Strandv. 10
</div>
You just typed error. 您刚刚输入错误。 You miss the id... just type id before = "content" in indexhtml files ... 您错过了ID ...只是在indexhtml文件中输入id =“ =” content“之前...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.