Aligning the title to the center in html. How to center text in CSS
This lesson is devoted to attributes and headers in HTML, which are indispensable elements of any HTML document. This is why it is so important to master this issue. This lesson explains what an attribute is and provides examples of working with attributes. The lesson also discusses headers used in HTML and provides examples of headers.
Attributes in HTML
What is an attribute? An attribute is a parameter that gives tags specific information. There can be a lot of these parameters. For example, using attributes we can align the text of a paragraph, set the font style and size, set the required indents, etc. Attributes are written inside tags, followed by an equal sign, then in double quotes attribute values are specified. Attributes are separated from each other by a semicolon.
Examples of working with attributes
Let's look at working with attributes using examples. The simplest example is let's take a paragraph tag
With the "align" attribute. Let's write:
Example of paragraph left alignment
The "align" attribute tells the browser to align the given paragraph to the left edge of the screen.
The following attributes can also be applied to the paragraph tag:
- align="center" – alignment to the center of the screen;
- align="right" – right alignment;
- align="justify" - aligns text to the width of the screen.
Now let's complicate the task - let's create HTML page using several different attributes. An example of such a page would have following code:
Example of a page with attributes in HTML Attributes in HTML