XHTMLboy Posted August 9, 2010 Share Posted August 9, 2010 Hi i'm new to CSS and i just wanted to know what value this applys to.e.g margin 15px 5px 15px 5px <-- Applys 15px to the top, right, bottom and left.But what does margin 15px 10px do. ? <-- how does that value get applyed? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 9, 2010 Share Posted August 9, 2010 With 4 values they are top, right, bottom, left. With 2 values the first is top/bottom and the second is left/right. Link to comment Share on other sites More sharing options...
dsonesuk Posted August 9, 2010 Share Posted August 9, 2010 first value top and bottom, then left and right . Link to comment Share on other sites More sharing options...
dsonesuk Posted August 9, 2010 Share Posted August 9, 2010 then you have margin: 10px 20px 30px; top right/left bottom Link to comment Share on other sites More sharing options...
XHTMLboy Posted August 9, 2010 Author Share Posted August 9, 2010 then you have margin: 10px 20px 30px; top right/left bottomThankyou so much, all your help is very much appreciated thanks. Link to comment Share on other sites More sharing options...
ApocalypeX Posted August 9, 2010 Share Posted August 9, 2010 * margin:25px 50px 75px 100px; o top margin is 25px o right margin is 50px o bottom margin is 75px o left margin is 100px * margin:25px 50px 75px; o top margin is 25px o right and left margins are 50px o bottom margin is 75px * margin:25px 50px; o top and bottom margins are 25px o right and left margins are 50px * margin:25px; o all four margins are 25px Link to comment Share on other sites More sharing options...
XHTMLboy Posted August 10, 2010 Author Share Posted August 10, 2010 * margin:25px 50px 75px 100px; o top margin is 25px o right margin is 50px o bottom margin is 75px o left margin is 100px * margin:25px 50px 75px; o top margin is 25px o right and left margins are 50px o bottom margin is 75px * margin:25px 50px; o top and bottom margins are 25px o right and left margins are 50px * margin:25px; o all four margins are 25pxThankyou ApocalypeX for you help, but when ever i try to do background-position: 0 2px it makes the image go down. Why is this?, shoulden't it make the image go 2px to the left and right? and which way is to 2px ment to move the image to? Thanksyou for your time in taking a look Link to comment Share on other sites More sharing options...
ApocalypeX Posted August 10, 2010 Share Posted August 10, 2010 Thankyou ApocalypeX for you help, but when ever i try to do background-position: 0 2px it makes the image go down. Why is this?, shoulden't it make the image go 2px to the left and right? and which way is to 2px ment to move the image to? Thanksyou for your time in taking a look Background-position is x and y cordinates.So it would be 0 pixels to the right and 2 pixels from the top. Link to comment Share on other sites More sharing options...
XHTMLboy Posted August 10, 2010 Author Share Posted August 10, 2010 Background-position is x and y cordinates.So it would be 0 pixels to the right and 2 pixels from the top.Oooh i get it now, so background-position: 5px 10px; will go 5px to the right and 10px up. ok thanks alot ApocalypeX Link to comment Share on other sites More sharing options...
ShadowMage Posted August 10, 2010 Share Posted August 10, 2010 so background-position: 5px 10px; will go 5px to the right and 10px up.Actually, it would go 5px right and 10px down. 0,0 starts at the top left corner and goes out and down from there. Link to comment Share on other sites More sharing options...
XHTMLboy Posted August 11, 2010 Author Share Posted August 11, 2010 Actually, it would go 5px right and 10px down. 0,0 starts at the top left corner and goes out and down from there.Oooh ok, i get it now. So 20px 30px would go 20px along starting at the top left and would go 30px down. Thankyou for the correction Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.