JM at Work
JM at Work

Reputation: 2437

Why is CSS positioning not reflected

I am following the tut from here but not following the exact codes

My work is http://jsfiddle.net/Zn7br/

I am wondering why my article.slideLeftBottom with CSS

.js .slideLeftBottom header, .js .slideRightBottom header { // left
    right: 5px;
    left: auto;
}

does not have right registered ... in FireBug it says right: 25px

Upvotes: 2

Views: 70

Answers (1)

JohnP
JohnP

Reputation: 50009

You can't define a right property unless your element is positioned absolutely or relatively. Has no effect on static elements (static is default)

.js .slideLeftBottom header, .js .slideRightBottom header { /* // left <- WRONG */
    position: absolute; /* NEEDED or relative*/
    right: 5px;
    left: auto;
}

http://www.w3schools.com/css/pr_pos_right.asp

EDIT

Took me a bit to notice, but you had added comments to your css with //, this doesn't work in CSS (I totally ignored that bit earlier!) and was messing up your code.

I updated your code and it shows properly now : http://jsfiddle.net/jomanlk/Zn7br/2/

Upvotes: 2

Related Questions