The difference between text-align and align of CSS

Source: Internet
Author: User
Text-align's introduction:

Grammar:

Text-align:left | Right | Center | Justify

Parameters:
Left: Right-justified
Right: Justify
Center: Center
Justify: Justify on both sides
Description
Sets or retrieves the alignment of text in an object.
The corresponding script attribute is textalign. Please refer to the other bibliography I have written.
Example:

p {text-align:center;}

What is the difference between text-align and align in HTML?

1.align: Specifies the horizontal alignment of the content in the P element.
2.text-align: Specifies the horizontal alignment of the text in the element.

Two properties use a different place, but it works the same! Align is relatively "narrow", for example:

Align (Align is the property of P):

<p align= "center" >this is some text!</p>

Text-align (Text-align is the property of CSS):

<p style= "Text-align:center" >

Both allow the content of p to be centered.

Align: Specifies the horizontal alignment of the content in the P element.
Text-align: Specifies the horizontal alignment of the text in the element.
Two properties use a different place!

<p align= "Center" > This is  some text!</p>

Align write directly on the attribute that is P

<p style= "Text-align:center" >

Text-align is the property of CSS
The align attribute of the P element is not supported in the XHTML 1.0 Strict DTD.
Please use CSS instead.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.