This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Musab Salih
over 9 years

Why it's doesn't work , 9/16

Hi , I spend a lot of my time in this page i don’t know what’s is the problem , Pleas chack the code .

<!DOCTYPE html>

    <html>
        <head>
    <title><h1 style="color: green; font-size:16px">Ch</h1></title>
        </head>
        <body>
            <h1>Big Heading</h1>
                <p style="color: violet"></p>A giant bear and a little duck were friends.</p>
                <p style="color: red"></p>But the bear got hungry and ate the duck.</p>
        </body>
    </html>

#Regards

Answer 54a31532e39efe349801751f

1 vote

Permalink

Here is what I put and the correct code:

<!DOCTYPE html>
<html>
    <head>
        <title style="font-size: 16px"> Changing the colors!</title>
    </head>
    <body>
        <h1 style="font-size: 16px; color: green"> Big Heading</h1>
            <p style="color: violet"> A giant bear and a little duck were friends.</p>
            <p style="color: red; font-size: 10px">But the bear got hungry and ate the duck.</p>
    </body>
</html>

I also noticed that you didn’t put delimiters (which are the ;/semi-colon sign from CSS styling), make sure to put them in after you put the color’s name. After styling a paragraph, make sure to not put a closing tag after the opening tag instead put it at the end of the content so like this:

<p style = "cursor: crosshair; color: red;">This is an example. </p>

Good luck, and make sure to ask more questions if you need help!

points
Submitted by Moh Suufi
over 9 years

4 comments

Musab Salih over 9 years

Thanks a lot :) i get it well

Moh Suufi over 9 years

You’re welcome.

Moh Suufi over 9 years

Make sure to mark it as best answer.

stetim94 over 9 years

this is not a best answer, please don’t. it is just an answer + there are already so many best answers

Answer 54a3da729113cb2c1d018b88

0 votes

Permalink

right, style is just an attribute, you can apply to many html elements. this: <title><h1 style="color: green; font-size:16px">Ch</h1></title> is not good. <h1></h1> should be used inside the body tags, not head tags. the styling of <title> is pointless since it shows up in the tab, where it will not be affected by styling like you just did, so that should just be: <title>Ch</title>

you didn’t apply style to <h1> don’t know if that is needed, since your question is in the wrong section.

you added an extra set of closing paragraphs: <p style="color: violet"></p>A giant bear and a little duck were friends.</p>

so, this means the bit that is styled is: <p style="color: violet"><!-- any text that would be here --></p>A giant bear and a little duck were friends. <!-- this will not be styled --></p>

so remove the additional closing paragraphs in both paragraphs, and you should be good to go.

points
Submitted by stetim94
over 9 years