+ 3
<center> tag is deprecated. How to do center aligning without this tag?
5 Antworten
+ 1
use the align attribute e.g. <hr align="center"/>
+ 1
you can also go with the CSS approach.
to center the text inside any element.
HTML
<div>Centered text.</div>
CSS
div {text-align: center;}
also if you would like to have the whole div centered on the html page.
HTML
<div>Centered text.</div>
CSS
div {
width: ( specify some width here. );
margin-left: auto;
margin-right: auto;
}
or to set margin in one line
margin: 0 auto;
or to apply custom top and bottom margin
margin: 5px auto 15px auto;
0
Use CSS and then reference that in a <div class=""></div>
0
align="center"