I´m having trouble automatically centering the p element without the use of margin-left. The body element is center aligned but since there is a background color on the p element it doesn´t work on it...
p {
background-color: dimGray;
width:250px;
margin-left: 630px;
}
h3 {
margin: 20px;
}
h1 {
margin-top: 30px
}
a {
color: red;
}
body {
background-color: black;
color: white;
text-align: center;
font-family: "Verdana", sans-serif;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Netflix</title>
<link rel="stylesheet" href="style/style.css">
</head>
<body>
<img src="https://lh3.googleusercontent.com/proxy/nusBlyscc3HZ_yW7ZSTS3E-Ci8ZZv_ALi1K1eWse3rlX2emUBz_tW0XbCMh9yp_pAnOLN24Ct2OWoBNvH629ziJr9EK_Q3PCB73IwAughUCGA4nZhjN1NvkAIVOq4LGIlw">
<h1>See what´s next</h1>
<h3>Watch anywhere, but mostly from home</h3>
<a href="https://mimo.app/r/homeflix.html">Try 30 Days Free</a>
<p>Watch TV shows and movies</p>
<script src="script.js"></script>
</body>
</html>
It´s the grey box I have trouble with centering automatically. I can´t seem to find a way to do it.