Sunday, 20 December 2015

Adding margin top moves everything, not one div?

I don't know why, but when I apply the last line of css, the div shifts both the topbar AND mainborder div. Super noob questions, but it is frustrating me so much. THANKS!

In my body is

 <div class="mainborder"> <div class="topbar"> <p>Testing<p> </div> </div> 

My css is:

.mainborder{ background-color:lightgray; height:1300px; width:1200px; margin:0 auto; } .topbar{ height:200px; width:100%; background-color:red; text-align: center; vertical-align: middle; margin-top:100px; } 


Epic visual tool

Epson 5030UB 2D/3D 1080p 3LCD Projector Submitted December 21, 2015 at 04:30AM by warlands719 http://ift.tt/1YqtCHs

No comments:

Post a Comment