Need help :)


#1

Hi, I need some help. I stuck on CSS position at 12. Review. I have this instruction:

We've put a div for you to use on the HTML tab. On the CSS tab:

Give that div a border of 1px solid black.
Give it a background color of #CC0000.
Set its top margin to 10px, its right margin to 5px, its bottom margin to 5px, and its left margin to 50px.
Set its top padding to 0px, its right padding to 30px, its bottom padding to 0px, and its left padding to 10px.

So I entered this:

.div {
border: 1px solid black;
background-color: #CC0000;
margin: 10px 5px 5px 50px;
padding: 0px 30px 0px 10px;
}

And I get this error:

Oops, try again. Did you set your div>'s border to 1px wide?

I clicked hint and get:
Seeing errors with the border width? Try resizing your browser by clicking ctrl+0 (Windows) or cmd+0 (Mac)

I done that, but unsuccessfuly . I use my laptop 14".

Can anybody help me?

Thank you


#2

here is an example of paragraph:

<p>i am a paragraph</p>

to apply styling to this paragraph you do the following;

p {
  property: value;
}

now you also have classes and id's:

<p class="classname">i am paragraph</p>
<p id="idname">i am a paragraph</p>

and in css to use the classes and id's:

.classname { property: value}
#idname { property: value;}

now, as you can see, you use a dot to use a class, and pound/number sign to use id in css. you use a dot (.div) as css selector, while i think you should select the html element. So without dot, i don't think your div has a class div.


#3

O thanks, thats it.

Regards


#5