简体   繁体   中英

Beginner html and CSS. Why doesn't this work?

Check my website at 90.231.109.239 please. 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. Could somebody please help ?

here is my 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

@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

<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 ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM