How to center the picture in html
This article mainly shows you "how to center a picture in html", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to center a picture in html".
How does html center the picture?
1. First we need to create a new html page.
2. Then create a new img tag in the body section and specify a picture.
3. Looking at the effect in the browser, you can find that the picture is left-aligned by default and is not displayed in the center.
4. Wrap the picture in a p or span tag and add a style attribute with a value of text-align:center to the tag.
The code is as follows:
Document
The above is all the contents of the article "how to Center a Picture in html". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!