0

please see http://jsfiddle.net/8mmbA/1/

How to make a separation between coordinate and dimension div , say 10 px. I tried margin and padding. For dimension the margin adds from coordinate 0 (left most part in the page), not from the previous div.

thanks.
bsr.

0

4 Answers 4

1

You need to add float:left to your dimension:

#location #dimension{float:left; margin-left:10px;}

Sign up to request clarification or add additional context in comments.

2 Comments

Keith.. thanks for the answer..may i ask u for a clarification, I thought float:left would carry over from the previous div. I read the float setting inherit till you explicitly clear it .. thanks again
Think of float as you would think of a newspaper image having text wrap around it. If you only float the first div, the 2nd div will still exist at the upper-left coordinate, but its contents will wrap around the first. You need to float both in order for them to respect each others' margins/padding.
0

http://jsfiddle.net/easwee/8mmbA/10/

Set it to display:block else margins won't trigger.

1 Comment

thanks.. but, I don't think ur conclusion was right.. see I updated your answer jsfiddle.net/8mmbA/13 . margin-right on the left div was the real cause
0

You can add padding-right: 10px; to the Coordinate div.

Comments

0

margin-right on the left div

http://jsfiddle.net/8mmbA/9/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.