I was solving a very simple exercise and I ran into a problem in the alignment of the elements.
I want the h1
to be centered. But the author of the tutorial uses *{ padding:0; margin: 0;}
so that everything in the document is centered, and that does not seem to be working.
I detail the code in html and css. And I also add an image of what the ebook suggests (with which I am learning) that should be the page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="A quiz game for ninjas">
<meta name="author" content="DAZ">
<title>Quiz Ninja</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<header>
<h1>Quiz Ninja!</h1>
</header>
<script src="js/scripts.js"></script>
</body>
</html>
And the document css:
* {
margin: 0;
padding: 0;
}
header {
font: bold 36px/120% Arial, Helvetica, sans-serif;
background: #333;
color: #c00;
text-transform: uppercase;
}
When I run the html on my browser, it looks like this. Do not worry about Javascript functionality because the capture of the ebook is of a more advanced instance, but the css file remains the same.