Center Tag in HTML
There are many ways to align the center of your content in CSS but there is only one way to do it in HTML. The center tag is used to align our HTML content, i.e. images, texts, videos, etc., in the web page’s center. If we use this tag, the content will appear in our center on all devices. This tag supports all elements, which means we can use any part inside the <center> tag. We cannot use attributes for this tag because this tag does not support any details.
<center> Your content <center>
<div styles = "border: 2px solid black"> <center> <p>Welcome to Wonder Develop</p> </center> </div>
- In the above code, we have created a <div> tag inside it we have <center> and <p> tags.
- If I want to center the <p>, so we have created a center tag inside the <div> and outside the <p>.
- See the output, the <p> tag content is centered on the box.