22. Positioning CSS. Problem, or perhaps a 'bug'?


#1

I'm stuck with this exercise, which explains how to adjust positioning. This is the original source code:
`body {
background-color: #b7d1c4
}

h2 {
font-family: Verdana;
font-weight: bold;
text-align: center;
padding-top: 25px;
padding-bottom: 25px;
color: #acd1b2;
}

img {
height: 170px;
width: 170px;
box-shadow: rgba(0,0,0,0.2) 10px 10px;

}

navbar {

/*Agregá tu CSS acá*/

left:50%;
margin-left:-254px;

}
(...)`

The exercise clearly says this:
"In the CSS tab, make #navbar fixed position and has a margin of -10px."; but:

#navbar {
/*Agregá tu CSS acá*/
position:fixed;
left:50%;
margin-left:-10px;
}

After pressing the "Save code" button shows me the full screen, I say "back to editor" and shows me this message in red:

¡Uy! Probá otra vez. Please follow the instructions on the Full Preview page to test your code.

And I: "how when what?"
How can I be wrong?
I need some extra help, otherwise, I can not go forward


#2

Hi

In the instructions, it is asked to modify the margin-top property, not the margin-left. So you should keep the line margin-left:-254px; and add the code for the margin-top.
I hope that it will help you


#3

I already tried
#navbar {
/*Add your CSS here*/
position: fixed;
left:50%;
/*margin-left:-254px;*/
margin-top: -10px;
}

And it worked the first time!
I read the instruction trusted, and has gone wrong.


#4

navbar {

position: fixed;
margin: -10px;
/*Agregá tu CSS acá*/

left:50%;
margin-left:-254px;

}
de está manera funciona espero te sirva!


#5

Hola, yo tenía el mismo problema pero ya lo solucioné. Fijate que en el archivo CSS faltan varios punto y coma. Agregalo, hacé lo que dice la instrucción y vas a ver que funciona


#6

Hi Guys ,
In this problem. you have to write "Position:fixed;" and "margin-top:10px;"
the one they mention in tutorials is wrong value. so instead of -10px it should be 10px.

Thanks,
Niraj


#8

This topic is rather old, if you still have new questions please create a new topic