0 votes
ago by
Hi All, I have for some reason does not work header tag in the CSS file (the text is not centered), a day googling, but I can not solve the problem
HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="Styles.css" rel="stylesheet">
<title>Aniwatchdotbbc</title>
</head>
<body>

<header>
<h1>Welcometo the anime world</h1>

</header>

</body>
</html>
CSS Code:
<style>

header {
text-align: center;
}

</style>
The files are in the same folder, but if you paste <style>header {text-align: center;}</style> into an HTML file, then everything works. I'm sorry if I wrote something stupid. Thanks in advance
ago by
smigles Thank you very much.
ago by
You have a tag <style> in the Styles.css file? It shouldn't be there.

1 Answer

0 votes
ago by
There must not be an HTML tag in the CSS code <style> .
...