Reputation: 308
Here is the problem Here is the css Ok so I want to create a simple portfolio website and I am a bit of a novice with HTML and CSS.
<body>
<header>
<h1>Sai Daniels</h1>
</header>
</body>
That's my HTML and my CSS
@import
url('https://fonts.googleapis.com/css?family=Raleway:300,400,700,900');
body{
font-family: "Raleway";
padding: 0;
margin: 0;
}
/** HEADER **/
header{
color: #00ff6c;
text-align: center;
background-color: #232323;
height: 1000px;
}
Even on other questions the answers don't help
I've noticed if I do this it fixes the problem
*{
margin:0;
padding:0;
}
The problem is that I'm the only one that has to do this and I've been told doing that can lead to problems.
Upvotes: 0
Views: 301
Reputation: 7295
The h1
tag has margin by default by many browsers, such as Google Chrome:
Your code overrides the user agent styles, which is why it works.
I normally use the following code as a quick normalize CSS:
* {
box-sizing: border-box;
margin:0;
padding:0;
}
Upvotes: 1