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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -