mrbean Posted September 28, 2012 Share Posted September 28, 2012 Hi, I want to have some space between my header element and the slider. I searched on the internet and tried margin-bottom in the header element but it doesn't give me the result I want( I use chrome browser). Here's the code link: http://goo.gl/NNHU8 Link to comment https://forums.phpfreaks.com/topic/268880-space-between-divs-elements/ Share on other sites More sharing options...
Mahngiel Posted September 28, 2012 Share Posted September 28, 2012 the margin actually exists. the problem is with your floated elements, as they are removed from the natural flow of the document, thus giving you the impression the margin isn't being applied. the answer to this is a 'clearfix'. You can go the old-school way and do a `<div class="clear"></div>` or you can go "semantic" and add your clears to a psuedo element like ':after'. Link to comment https://forums.phpfreaks.com/topic/268880-space-between-divs-elements/#findComment-1381530 Share on other sites More sharing options...
mrbean Posted September 28, 2012 Author Share Posted September 28, 2012 Check the site again, I added header:after{margin-bottom} But no effect? Link to comment https://forums.phpfreaks.com/topic/268880-space-between-divs-elements/#findComment-1381532 Share on other sites More sharing options...
mrbean Posted September 28, 2012 Author Share Posted September 28, 2012 I did some research on 'clearfix' @ google and I found an solution. Thanks mahngiel for your help! Link to comment https://forums.phpfreaks.com/topic/268880-space-between-divs-elements/#findComment-1381543 Share on other sites More sharing options...
Mahngiel Posted September 28, 2012 Share Posted September 28, 2012 glad to help Link to comment https://forums.phpfreaks.com/topic/268880-space-between-divs-elements/#findComment-1381545 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.