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

0 points
Submitted by D-vo
almost 11 years

display : block; is not working

Oops, try again! Did you remember to set the display property of your <div>s to block?

my code

    div {
    height: 50px;
    width: 100px;
    border: 2px solid black;
    border-radius: 5px;
    display : block; 
    
}
what was asked of me 
    div {
    height: 50px;
    width: 100px;
    border: 2px solid black;
    border-radius: 5px;
    /*Add your CSS here!*/
    
}

Answer 51b690f852f8635865001a00

8 votes

Permalink

Try no white space between display and the colon :

points
Submitted by tony de araujo
almost 11 years

6 comments

D-vo almost 11 years

still a no go. :( thanks anyway

Bonner83 almost 11 years

Thank you! Worked fine! But seems to be a bug in the correction tool!

D-vo almost 11 years

ok it worked now thanks

Joby John K.J. over 10 years

This worked for me too. Many Many Thanks! i changed from “display : block;” to “display:block;”

ZHANG YiZhi about 9 years

It still doesn’t work for me.

tony de araujo about 9 years

Please paste your code and exercise number on the biggest text window below

Answer 54be1b75937676d442001671

0 votes

Permalink

div { height: 50px; width: 100px; border: 2px solid black; border-radius: 5px; display: block; } The Box Model 2. Taking up place It tells me “Oops try again” over and over again.

points
Submitted by ZHANG YiZhi
about 9 years

1 comments

tony de araujo about 9 years

Thanks for pasting your code. I tested your code on my own exercise and it passed validation. Try refreshing the browser with CTRL f5 ( or CMD r if on a MAC). If it still doesn’t work then your problem is somewhere else and I would have to see the whole code instead of just this little snippet.

Answer 54bef04376b8fe40e800058f

0 votes

Permalink

  • { border: 1px dashed blue; }

div { height: 50px; width: 100px; border: 2px solid black; border-radius: 5px; display: block; }

#one { background-color: #FF0000; }

#two { background-color: #0000FF; }

#three { background-color: #FFD700; }

#four { background-color: #308014; }


Edited by Tony de Araujo (moderator) This is the HTML part for 2/25:

<!DOCTYPE html>
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
        <title>Result</title>
    </head>
    <body>
        <div id="one"></div>
        <div id="two"></div>
        <div id="three"></div>
        <div id="four"></div>
    </body>
</html>
points
Submitted by ZHANG YiZhi
about 9 years

3 comments

tony de araujo about 9 years

I tested your code and it passed for me. I pasted my HTML part for you to test yours to make sure there is nothing wrong with it. Did you try clearing the browser with CTRL f5?

ZHANG YiZhi about 9 years

Yes, I’ve cleared the browser. with F5. What should I do? This is the only exersice I left to finish the HTML&CSS course.

tony de araujo about 9 years

CTRL + f5 if on windows, CMD + r if on Mac. If it still fails try passing validation by using a different browser. Or Please paste your HTML section for me to test it since we have not gone that route yet. Or copy my HTML in place of yours just in case…