Basic knowledge of web page production (html) (2) Basic operations

零下一度
Release: 2017-05-05 13:56:22
Original
1473 people have browsed it

1.1HTML title

The heading (Heading) is defined through tags such as

-

.

Defines the largest title.

Defines the smallest heading.

<html>  
<body>  
<h1>This is heading 1</h1>  
<h2>This is heading 2</h2>  
<h3>This is heading 3</h3>  
<h4>This is heading 4</h4>  
<h5>This is heading 5</h5>  
<h6>This is heading 6</h6>  
<p>请仅仅把标题标签用于标题文本。不要仅仅为了产生粗体文本而使用它们。请使用其它标签或 CSS 代替。</p>  
</body>  
</html>
Copy after login

1.2HTML Horizontal Line


tag creates a horizontal line in the HTML page. The

hr element can be used to separate content.

<html>  
<body>  
<p>hr 标签定义水平线:</p>  
<hr />  
<p>这是段落。</p>  
<hr />  
<p>这是段落。</p>  
<hr />  
<p>这是段落。</p>  
</body>  
</html>
Copy after login

1.3HTML Comments

You can insert comments into the HTML code, so you 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:

<html>    
<body>    
<!--这是一段注释。注释不会在浏览器中显示。-->    
<p>这是一段普通的段落。</p>  
</body>  
</html>
Copy after login

Comment: An exclamation point needs to be followed immediately after the opening bracket (the left bracket), but not before the closing bracket (the right bracket).

Tip: Proper use of comments can help with future code editing work.

2.1HTML Line Break

If you want to wrap (new line) without creating a new paragraph, please use < ;br /> Tags

<html>
<body>
<p>To break<br />lines<br />in a<br />paragraph,<br />use the br tag.</p>
</body></html>
Copy after login

2.2HTML Output - Helpful Tips

We cannot determine the exact effect of the HTML being displayed. The size of the screen, as well as adjustments to the window, may lead to different results.

With HTML, you cannot change the output by adding extra spaces or line breaks to the HTML code.

When displaying the page, the browser will remove extra spaces and blank lines in the source code. All consecutive spaces or empty lines are counted as one space. Note that all consecutive empty lines (newlines) in HTML code are also displayed as a single space.

<html>  
<body>  
<h1>春晓</h1>  
<p>  
    春眠不觉晓,  
      处处闻啼鸟。  
        夜来风雨声,  
          花落知多少。  
</p>  
<p>注意,浏览器忽略了源代码中的排版(省略了多余的空格和换行)。</p>  
</body>  
  </html>
Copy after login

【Related recommendations】

1. Free html online video tutorial

2. html development manual

3. php.cn original html5 video tutorial

The above is the detailed content of Basic knowledge of web page production (html) (2) Basic operations. 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