5 replies [Last post]
macamba
macamba's picture
Offline
Regular
Arnhem
Last seen: 14 years 15 weeks ago
Arnhem
Timezone: GMT+1
Joined: 2007-03-22
Posts: 45
Points: 0

Hi all,

What happens because of the following code?

margin:1em 0;

I know the margin is set to 1em. But what happens because of the 0 after the 1em?

Macamba

mihirc
mihirc's picture
Offline
Leader
Pune, Maharashtra, India
Last seen: 8 years 26 weeks ago
Pune, Maharashtra, India
Timezone: GMT+5.5
Joined: 2007-05-09
Posts: 728
Points: 204

hi, wen you say margin 1em

hi,
wen you say margin 1em 0; then it means that the top margin is 1em while all the others are zero.

Basically wen you giv margins it goes in the following way... from clockwise, top right bottom left.

mihir Smile

Proprietor - Thoughtfulviewfinder Services
Web Development | Design | Merchandise | Photography
My personal blog: MihirChhatre.com

macamba
macamba's picture
Offline
Regular
Arnhem
Last seen: 14 years 15 weeks ago
Arnhem
Timezone: GMT+1
Joined: 2007-03-22
Posts: 45
Points: 0

Thanks

Thanks :blushing:

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 20 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Read up on margin (and other

Read up on margin (and other short cuts) at the w3c css 2.1 spec. Its pretty clear and easy to understand on such things.

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 20 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

mihirc wrote:hi, wen you say

mihirc wrote:
hi,
wen you say margin 1em 0; then it means that the top margin is 1em while all the others are zero.

Basically wen you giv margins it goes in the following way... from clockwise, top right bottom left.

mihir Smile

This is WRONG. As I say in my previous post, read up on the spec. I could repeat it here, but you are better off getting used to referring to it for specific questions like this. fwiw, all current browsers follow the spec on shortcuts.

mihirc
mihirc's picture
Offline
Leader
Pune, Maharashtra, India
Last seen: 8 years 26 weeks ago
Pune, Maharashtra, India
Timezone: GMT+5.5
Joined: 2007-05-09
Posts: 728
Points: 204

hi, Thanks for that.... i

hi,

Thanks for that.... i guess i learnt half of it... a addition to my knowledge.
I always, gave it to all 4.

anyways, thanks...

mihir Smile

Proprietor - Thoughtfulviewfinder Services
Web Development | Design | Merchandise | Photography
My personal blog: MihirChhatre.com