HTML title summary recommendations

php中世界最好的语言
Release: 2018-01-22 10:44:56
Original
1488 people have browsed it

This time I will bring you a summary and recommendation of HTML titles. What are the precautions of HTML titles? Here are practical cases, let’s take a look.

HTML: Title

Heading is defined through tags such as

-

.

<h1> 定义最大的标题。<h6> 定义最小的标题。
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
Copy after login

Tip: The browser will automatically add blank lines before and after the title. h1 serves as the main heading (the most important), followed by h2 (the next most important), then h3, and so on. Tip: By default, HTML will automatically add an extra blank line before and after block-level elements, such as paragraphs and heading elements.

-

The align attribute is deprecated in HTML4/5. Please use CSS instead. The title supports event attributes and global attributes

Set title alignment:

CSS syntax:

text-align:right ">

Method 1:

<!DOCTYPE html>  
<html>  
<body>  
<h1 style="text-align:center">This is heading 1</h1>  
<h2 style="text-align:left">This is heading 2</h2>  
<h3 style="text-align:right">This is heading 3</h3>  
<h4 style="text-align:justify">This is heading 4</h4>  
</body>  
</html>
Copy after login

Method 2:

<!DOCTYPE html>  
<html>  
<head>  
<style>  
h1 {text-align:center}   
h2 {text-align:left}   
h3 {text-align:right}   
</style>  
</head>  
  
<body>  
<h1>This is heading 1</h1>  
<h2>This is heading 2</h2>  
<h3>This is heading 3</h3>  
</body>  
</html>
Copy after login

HTML: Horizontal line


tag is created in the HTML page horizontal line. The

hr element can be used to separate content.

<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
Copy after login

This is a paragraph

Tip: Using horizontal lines (
tags) to separate sections in an article is one way (but not the only way). HTML5 does not support the
align attribute. Please use CSS instead.

In HTML 4.01, the align attribute of


has been deprecated.

align attribute specifies the alignment of horizontal lines.

Note: Unless the width attribute is set to less than 100%, the align attribute will have no effect.

CSS syntax (IE and Opera):


CSS syntax (Firefox, Chrome, and Safari):


margin-right:0">

CSS syntax (cross-browser):


Attribute Value Descriptioncss syntax format

align left
center
right HTML5 is not supported. HTML 4.01 is deprecated. Specifies the alignment of the


element

noshade noshade is not supported by HTML5. HTML 4.01 is deprecated. Specifies that the color of the


element should be rendered as a solid color.

size pixels HTML5 is not supported. HTML 4.01 is deprecated. Specifies the height of the


element.

width pixels
% HTML5 is not supported. HTML 4.01 is deprecated. Specifies the width of the


element.

<!DOCTYPE html>  
<html>  
<body>  
<p>This is some text. This is some text. This is some text.</p>  
<hr style="width:50%;text-align:left;margin-left:0">  
<p>This is some text. This is some text. This is some text.</p>  
</body>  
</html>
Copy after login

HTML: Comments

You can insert comments into HTML code, which can improve its readability and make the code easier to understand. The browser ignores comments and does not display them.

The comment is written like this:

Comment: The last two forward slashes (/ /) is the JavaScript comment symbol. This ensures that JavaScript will not execute the --> tag.

In addition to their obvious role in source documents, many web servers also use comments to implement features unique to document server software. These servers can scan documents for specific character sequences within traditional HTML/XHTML comments and then take appropriate actions based on commands embedded in the comments. These actions may be as simple as including text from other files (so-called server-inside include), or they may be as complex as executing other commands to dynamically generate the content of the document.

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

Detailed explanation of examples of HTML text formatting

What are the list tags in html?

The basics of HTML editing (a must-read for beginners)

The above is the detailed content of HTML title summary recommendations. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!