zgkhoo Posted August 24, 2007 Share Posted August 24, 2007 [code margin: 1em 0; wat is the 0's in the above codes meant? thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/ Share on other sites More sharing options...
Ryokotsusai Posted August 24, 2007 Share Posted August 24, 2007 margins, padding, borders, etc can be done all in one shot by using statements like: margin: 1em 0 1em 0; or the shortened margin: 1em 0; basically with 2 it is saying top & bottom margins = 1em and left & right margins = 0 (none) if you used all 4 it would be in the order top, left, bottom, and right margins and 1 would set all of them to the same thing hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-332914 Share on other sites More sharing options...
AndyB Posted August 24, 2007 Share Posted August 24, 2007 top, right, bottom, left (clockwise) is the order in which to specify them. More info - http://www.456bereastreet.com/archive/200502/efficient_css_with_shorthand_properties/ Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-332923 Share on other sites More sharing options...
Ryokotsusai Posted August 24, 2007 Share Posted August 24, 2007 top, right, bottom, left (clockwise) is the order in which to specify them. More info - http://www.456bereastreet.com/archive/200502/efficient_css_with_shorthand_properties/ I thought that it seemed backwards Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-332937 Share on other sites More sharing options...
zgkhoo Posted August 24, 2007 Author Share Posted August 24, 2007 then 0 above=right? Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-332961 Share on other sites More sharing options...
bronzemonkey Posted August 24, 2007 Share Posted August 24, 2007 then 0 above=right? Did you even read Ryokotsusai's first post? Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-333048 Share on other sites More sharing options...
zgkhoo Posted August 24, 2007 Author Share Posted August 24, 2007 if you used all 4 it would be in the order top, left, bottom, and right margins top, right, bottom, left (clockwise) is the order in which to specify them which 1 is the correct 1? 0 stand for 0em? i just wanna double confirm.. Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-333052 Share on other sites More sharing options...
wildteen88 Posted August 24, 2007 Share Posted August 24, 2007 0 just mean no margin for the left and right. Note: margin: 1em 0; means apply a margin of 1em to the top and bottom and zero for the left and right. When you specify a zero for a value you don't have to provide a unit. You only set a unit for a size when you set a value greater than zero. Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-333254 Share on other sites More sharing options...
AndyB Posted August 24, 2007 Share Posted August 24, 2007 which 1 is the correct 1? 0 stand for 0em? i just wanna double confirm.. clockwise - top, right, bottom, left is absolutely the right order when all four are specified. 0 stands for zero, nothing, so units are not required. A 'good' practice is to include the units even for zero values. If you read the link I provided ALL will be clear. Quote Link to comment https://forums.phpfreaks.com/topic/66480-margin-curious/#findComment-333341 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.