html - padding in one div affects other divs -


this question has answer here:

i have 3 inline-block divs this:

<div style="display:inline-block">div1</div> <div style="display:inline-block; padding-top:5px">div2</div> <div style="display:inline-block">div3</div> 

i added padding second div display little lower, makes others divs go down well. how make second div display lower?

here jsfiddle: http://jsfiddle.net/my6hp/

the same thing asked here, accepted answer suggests using absolute positioning, not do.

change alignment on other divs allign @ top (via vertical-align:top;):

<div style="display:inline-block; vertical-align:top;">div1</div> <div style="display:inline-block; padding-top:5px">div2</div> <div style="display:inline-block; vertical-align:top;">div3</div> 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -