-1
html,
body {
  margin: 0;
  padding: 0;
}
.tribute-header {
  background-color: black;
  color: white;
}

The above is my code and I am still seeing this space. Please refer to the image attached and the arrow shows the space I want to remove. Kindly help.

enter image description here

dunubh
  • 45
  • 1
  • 7
  • Press F12 and go to `Elements` tab, then on the top left you will have a square box with a cursor on it, click on it and then your elements should have a color when you hover your cursor over them, go on that white margin and click, then look in the `Elements` tab down at the `Styles`. There you will get all the styling for that div or whatever it is, try to modify the attributes in the browser until it dissapears then do those modifications in your code –  Sep 12 '21 at 21:04
  • 1
    properly a default margin of a `block`level element such as a title, header or paragraph. – tacoshy Sep 12 '21 at 21:04
  • please show the HTML part of this... (what is `.tribute-header` element) – Mister Jojo Sep 12 '21 at 21:05

1 Answers1

1

Add this to your code:

*{margin:0; padding:0; box-sizing: border-box;}

So the root of every element on your website will be as above.

  • Thank you, it solved my problem. Also, can I change some of the elements later on the web page or will they not be changed because I have used ```*{margin:0; padding:0; box-sizing: border-box;} ``` – dunubh Sep 12 '21 at 21:13
  • So this what is inside *{here} will apply to every element. If you need to add some padding or margin to an element which requires then you will just need to do that. – ProgramistaZaDyche Sep 12 '21 at 21:23
  • a global reset is not recommended. Its a nuke that requires a lot of fixing afterwards. The right apporach should be to nly adress the element in question instead of fixing everything else afterwards. – tacoshy Sep 12 '21 at 21:40