This article describes the Align property in HTML, describes how the Align property is centered on text, and how the HTML align property is centered on the image, so let's take a look at this article.
First of all, let's say the center attribute in HTML:
Today we recommend the use of the Align attribute, the Align attribute can be used in many tags, this article mainly introduces the use of align attributes to the text and Picture Center display.
Now let's say that the HTML Align property centers the text, so let's look at a complete code:
<!doctype html>
This is a simple code that shows the effect,
What you see is not implemented with any tags, which is displayed by default in the top left of the browser.
Now we want to center the text above, how should we do it?
Yes, that's the Align property that I introduced at the beginning of the article. Let's add the align attribute to it.
Now look at the code:
<!doctype html>
Because the text label is originally used to summarize the paragraph P tags, so we use the P tag, which adds a align attribute equals center. is to have all the text in the P tag centered. Let's look at the effect:
This is all displayed in the middle of the browser.
This is the way the HTML align property is centered on the text. (Want to see more, here are Topic.alibabacloud.com's HTML online video tutorial)
Now let's take a look at the center of the picture with the Align attribute:
All know that the picture label is displayed with this single label, so the code shown is as follows:
<!doctype html>
I added a network image to the above code, now look at the effect:
Obviously, this image is displayed at the top left of the browser's default. Now let's try adding the IMG tag to the align attribute:
<body><p align= "Center" > This is a piece of text, without any tags, see where I am now </p></body>
Above I added the Align attribute, then the effect quickly changed, this certainly must in html4.01 inside can use. So I'm not going to show the picture here. Everyone can read it.
This article about the Align property of HTML to the end of this, there is a problem can be in the message below.