Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing margin-top to div in CSS

Tags:

html

css

margin

I am trying to change the margin-top property of a div in a WordPress theme, however it does not seem to work. I have added the following line to the custom css stylesheet:

 div#primary {
     display: block;
     margin-top:50px;
   }

However the div whose property I want to change does not move down. The example can be found at the following URL: http://who.designbond.co.uk/contact-2/ The div I need to move down is the one containing the text of Phylosophy. Can anyone explain to me what I am doing wrong? Thanks

like image 796
bertassa Avatar asked Dec 20 '22 07:12

bertassa


2 Answers

That div has an inline style with margin-top: 0px, which is overriding your stylesheet.

You need to remove or modify that inline style, or (in a pinch, and don't tell anyone I said this) add !important to your stylesheet rule).

like image 68
RichieHindle Avatar answered Dec 28 '22 22:12

RichieHindle


div#primary {
     display: block;
     margin-top:50px !important;
}

I know it's not a good thing to do (adding !important), but it can help.

like image 42
Luke Avatar answered Dec 28 '22 23:12

Luke