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">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="Styles.css" rel="stylesheet">

<h1>Welcometo the anime world</h1>


CSS Code:

header {
text-align: center;

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> .