The case
I am making a single page website which uses One Page Navigation jQuery plugin for smooth scrolling. The content is grouped into three pages:
- home.html
- abilities.html
- portfolio.html
The idea is when a user is in home.html a jQuery function (js/pop4.js) loads the content of the other two pages in divs with the respective names:#abilities-wrapper and #portfolio-wrapper and vice versa when in abilities.html the script loads the other two pages in current page.
I am also using a jQuery script which adds possition:fixed,'top':0, 'left':0 to the menu after scrolling down and adding or removing .hidden class to two other divs.
The problem:
- I want the divs to have a margin-top: 120 px. I set this in the css file
That is my css file:
#home-wrapper{
margin-top:120 px;
}
#abilities-wrapper{
margin-top:120 px;
}
#portfolio-wrapper{
margin-top:120 px;
}
This is what I get in Firebug:
#home-wrapper{
}
#abilities-wrapper{
}
#portfolio-wrapper{
}
Because you have a syntax error. Why you have white-space in between value and unit in which it is measured ? It should be like this:
That
margin-topproperty is not set as you have error in your code and hence, also not considered as a style of that div.Fiddle