This forum is now read-only. Please use our new forums at discuss.codecademy.com.

CSS: An Overview Forum

View Course » View Exercise

397 points
54de0362d3292fc4de0019f8_59629231
Submitted by
Sarah J Bojorquez
over 2 years ago

Please help with 23/26

I have been stuck forever now and have looked through all the help I can find and still cannot see what I am doing wrong here. It keeps telling me to change the font to Verdana in h1:
html:

</head>
<style>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
</style>
<body>
<h1>Doggy</h1>
<p>pets</P>
</body>

CSS:
h1 {
font-family: Verdana;
color: #576D94;
}
p {
font-size: 18px;
color: #4A4943;
}

What am I doing wrong here??


1 vote

permalink

       <!DOCTYPE html>
    <html>
        <head>
            <title>Result</title>
            <link rel="stylesheet";type="text/css";href= "stylesheet.css"/>
        </head>
        <body>
        <h1>I'm Sai Krish</h1>
        <p>Test</p>
        </body>
    </html>

h1 {
  font-family: Verdana;
  color: #576D94;
}

p { 
    font-size: 18px;
    color: #4A4943;
}

Error shown: Oops, try again. Don't forget to set your h1 font to Verdana!

490 points
A3c4dcef9910316cb38f57cc5ce6735a?s=140&d=retro
Submitted by
Sai krishna
over 2 years ago

1 Comment

A3c4dcef9910316cb38f57cc5ce6735a?s=140&d=retro Sai krishna over 2 years ago

Doesn't work for external stylesheet as well


0 votes

permalink

good you posted your html + format, because that is where there is a tiny mistake. You can use css in 3 ways: inline-style, internal stylesheet and external stylesheet. you are familiar with inline-style:

<p style="color: red; font-size: 16px">

this is how you got introduced to css, using the style attribute (which is called inline-style, because well, it is in the html line)

then there is internal stylesheet, which means you use the style elements:

<head>
<style>
/* some css code */
</style>
</head>

and then there is external stylesheet, in which case you need to tell html where to find the css file with <link>:

<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
</head>

you can perfectly fine combine internal and external stylesheet if you want:

<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<style>
/* some css code */
</style>
</head>

you linked to stylesheet (html property) inside a internal stylesheet (where you can only write css, that is not going to work). for the exercise use the external stylesheet

2822 points
593d545c83696644420003b7_64554016
Submitted by
stetim94
over 2 years ago


0 votes

permalink

@sai,

your link to stylesheet is faulty. html attributes (type, rel, href) are separated by spaces, not semi-colons.

style elements are seperated by a semi-colon:

<p style="font-size:16px;color:red;">

2822 points
593d545c83696644420003b7_64554016
Submitted by
stetim94
over 2 years ago