+ 1
The align="center" attribute doesnt work if i add header tags,italic tags etc
<p align="center">welcome</p>. works <p align="center"><h1>welcome</h1></p> doesnt works
4 ответов
+ 3
h1 is a block element and will take up the whole screenwidth, so technically it is aligned.
Try
text-align: center;
in CSS
+ 3
<h1 style="text-align:center">text</h1>
+ 3
Try this, changing attributes inside the CSS <style></style> tags
You can also make a style.css document with all your styling information there
<!DOCTYPE html>
<html>
<head>
<style>
p, h1 {text-align: center;
}
</style>
</head>
<body>
<h1>welcome</h1>
<p>welcome</p>
</body>
</html>
+ 1
its in html