2 replies [Last post]
kiwis
kiwis's picture
Offline
Enthusiast
Last seen: 1 year 48 weeks ago
Timezone: GMT+13
Joined: 2009-03-07
Posts: 65
Points: 102

https://jsfiddle.net/er2z684c/

Before I added my Location is looked okay but it's pushed my first item down now?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 day 3 hours ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9743
Points: 3822

Not tested

I suspect you're experiencing margin collapse. Try adding {padding-top: 1px;} to the LI or DIV element. Or, you may replace the 50px top margin with 50px top padding on the parent. If I'm right, the H2 collapses through div.card-block and .card-block's margin collapses through LI.

See https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

helldog2004
helldog2004's picture
Offline
Enthusiast
Netherlands
Last seen: 3 years 11 weeks ago
Netherlands
Timezone: GMT+2
Joined: 2014-03-02
Posts: 205
Points: 239

You can solve this easily by

You can solve this easily by adding float: left; on the .card
https://jsfiddle.net/er2z684c/11/ <-- updated

Check Maximum Webdesign for your online solutions