2 replies [Last post]
kiwis
kiwis's picture
Offline
Enthusiast
Last seen: 2 years 10 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: 8 hours 47 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9749
Points: 3831

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 25 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