margin-bottom not working on divs

12,706

Change your CSS for the image containers to display: inline-block; instead of display: inline;

This question has been asked before, and has been answered here: https://stackoverflow.com/a/8782644/3781678

Share:
12,706
Alex Williams
Author by

Alex Williams

I am a Freelance Website Developer. I mainly produce websites over WordPress for small businesses. My favorite tool is PHP and I also like to create websites from sliced PSD's that I create and templatize. I am currently learning to develop Android apps and also becoming more familiar with WordPress' advanced features and building custom themes.

Updated on June 14, 2022

Comments

  • Alex Williams
    Alex Williams about 2 years

    Can someone help me figure out why my margin-bottom rule within my mobile view media query is not working?

    I have even added a class to clear the floats named .clearer but that isn't working either. All I want is for the left image to have a 30px margin below it on the mobile view.

    Here is the page... http://www.haveaseatrentals.com/seat-yourself/

    CSS rule from the mobile view's media query and the rule that I am using to clear the floats...

    #seatYourselfLeft {margin-bottom: 30px; }
    .clearer{clear:both; width:100%; height:0; display: block;}
    

    Any help is greatly appreciated.

  • Feek
    Feek almost 10 years
    @AlexWilliams It worked for me on your site! You need to add margin-bottom: 30px; to #seatYourselfLeft, that is not present on your site.