3 Replies - 238 Views - Last Post: 26 December 2017 - 09:43 AM

#1 TaffyJ   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-December 17

DIV not at the extreme top

Posted 23 December 2017 - 10:40 PM

I am new to development and having an headache with this. here is my CSS code:


* {
width: 0px;
padding: 0px;
}


.mainHead {
 width: 100%;
height: 70px;
padding-top: 0px;
background-color: #000;
}





The issue I have is that the box that is created by my DIV (the DIV has the mainHead class) does not go all the way up to the top of the page. So, since the background color of the page body is a different color, I am seeing about 10px of the background color to the top of the DIV; I want the DIV to go all the way to the top of the page. How can I get this done?

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: DIV not at the extreme top

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5241
  • View blog
  • Posts: 14,037
  • Joined: 18-April 07

Re: DIV not at the extreme top

Posted 23 December 2017 - 10:52 PM

There are many ways to do it, but until we can see what you are talking about it is hard to tell you the way you can do it for your situation. Do you have a URL so we can see what is going on? There can be any number of things that are preventing you. Margins at the top of the body, an invisible element pushing it down, some positioning problem etc. Until we see your page, it is hard to say which it is.
Was This Post Helpful? 0
  • +
  • -

#3 nesir28   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 51
  • Joined: 11-August 17

Re: DIV not at the extreme top

Posted 24 December 2017 - 07:54 AM

I struggled like this alot before i learned how to implement things properly..... Go to chrome , open deveoper tools , then click the inspect icon and float you most over that area , once it highlights click it , it will bring up the element ad class and rules of the item in that space , if it brings up your main div and is highlighted orange its probably a margin if its highlighted green its somethings padding.
Was This Post Helpful? 0
  • +
  • -

#4 TaffyJ   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-December 17

Re: DIV not at the extreme top

Posted 26 December 2017 - 09:43 AM

View PostMartyr2, on 23 December 2017 - 10:52 PM, said:

There are many ways to do it, but until we can see what you are talking about it is hard to tell you the way you can do it for your situation. Do you have a URL so we can see what is going on? There can be any number of things that are preventing you. Margins at the top of the body, an invisible element pushing it down, some positioning problem etc. Until we see your page, it is hard to say which it is.


I figured it out. You were right; something was pushing it down; now I am all good. Thanks!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1