2/10 Code is not working


#1

Hi. I saw questions about this question, but none seemed to answer mine. I have the following code:

.nav a {
color: #5a5a5a;
font-size: 11px;
font-weight: bold;
padding-top: 14px;
padding-bottom: 14px;
padding-left: 10px;
padding-right: 10px;
text-transform: uppercase;
}

The "main.css" line is in the html code.

I keep getting the error telling me to set the color to #5a5a5a. Not sure what I'm doing wrong. It looks right to me!

Thanks.


#2

Sorry, but I have to ask, because it looks perfect, did you put all of that code in the main.css file?


#3

Hi. Yes it's in the main.css

Sorry I forgot to mention that! :smile:

I should also mention that I tried resetting the code and pasting.


#5

I've just copy/pasted your code here and it is working just as it should.

In main.css, there is no other code besides that?

I can't think of anything else to check!


#6

Yep, that's all that's in there. Must just be a little bug or something. Thanks for trying!


#7

One thing you could try, if you have one, is a different web browser.


#8

Hello,

I've got the exact same issue. I've got the following code in the main.css file:
.nav a {
color: #5a5a5a
font-size: 11px
font-weight: bold
padding-top: 14px
padding-bottom: 14px
padding-left: 10px
padding-right: 10px
text-transform: uppercase
}

I keep getting the following error in a few browsers:
Oops, try again. Set the color of the a elements inside

..
to #5a5a5a

If I revert back to no style specifications other than colour the error changes to:
Oops, try again. Set the font-weight to bold.

If I add any other styling it goes back to the original error.

Open to any suggestions on how to tackle this bug, if it is, indeed, one :smile:


#9

You are missing all of your semicolons. You have to put a semicolon between every property/value pair, like this:

color: #5a5a5a;
font-size: 11px;

#10

Ah, I was completely blind to that one, thank you for your help!


#11

Guys I found the solution to fix this problem. The solution is

  • You have to write new code in index.html
    -Then you see

    -Then you write new code :

    -Finally write these down in main.CSS:
    .nav a {
    color: #5a5a5a;
    font-size: 24px;
    font-weight: bold;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: 10px;
    padding-right: 10px;
    text-transform: uppercase;
    }

#12

Something must have gone wrong with your exercise because the index.html file should have all of that code already, plus a lot more, mine has code all the way down to line 52. If anyone does not see all of that code then they should use the Reset code button to restore it.


#13

at first i think so but when i did like this it's work well :grin:


#14

Where do write


#15

Does this help?


#16

A post was split to a new topic: 2. ''Oops, try again. Set the font-weight to bold'