Express half hour HTML Notes (a)

XML learned HTML, then you can get started quickly

table of Contents

What is HTML?

HTML title

Examples

HTML paragraph

Examples

HTML links

Examples

HTML image

Examples

Note path reference file:

Examples of the above collection:

HTML attributes

note:

Common attributes:

Note

Level

Commonly used tags

Change font size

HTML output omit redundant spaces


What is HTML?

HTML is a language used to describe web pages.

  • Refers to an HTML Hypertext Markup Language: H yper T EXT M arkup L anguage
  • HTML is not a programming language, but a tag language
  • Markup Language is a set of markup tags (markup tag)
  • HTML uses markup tags to describe web pages
  • HTML documents contain HTML tags and text content
  • HTML document also called web pages

HTML title

HTML title (the Heading) by <h1> - defined <h6> tag.

Examples

<h1>这是一个标题</h1>

<h2>这是一个标题</h2>

<h3>这是一个标题</h3>

HTML paragraph

By HTML paragraph tag <p> defined.

Examples

<p>这是一个段落</p>

<p>这是另外一个段落</p>

HTML links

HTML links are defined by labels <a>.

Examples

<a href="https://blog.csdn.net/qq_41895747">我的CSDN博客</a>

HTML image

HTML image is defined by a tag <img>.

Examples

<img src="/images/logo.png" width="258" height="39" />

Note path reference file:

1, * .html file with the * .jpg file (f disk) in different directories:

<img src="file:///f:/*.jpg" width="300" height="120"/>

2, * .html file with the * .jpg images in the same directory:

<img src="*.jpg" width="300" height="120"/>
3, * .html file with the * .jpg images in different directories:

a, pictures * .jpg in the image folder, * html follow. image in the same directory:

<img src="image/*.jpg/"width="300" height="120"/>

b, pictures * .jpg in the image folder, * .html in connage folder, image with connage the same directory:

<img src="../image/*.jpg/"width="300" height="120"/>

4, if the picture from the network, then write the absolute path:

<img src="http://static.runoob.com/images/runoob-logo.png" width="300" height="120"/>

Examples of the above collection:


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML学习实例</title>
</head>
<body>
 
<h1>我的第一个标题</h1>
<h2>二级标题</h2>
<h3>三级标题</h3>
 
<p>我的第一个段落</p>
<a href="https://blog.csdn.net/qq_41895747">我的CSDN博客</a>
<br><!--换行-->
<img src="image/icon.png" width="100" height="100">
 
</body>
</html>

HTML attributes

  • HTML element can be set property
  • Element attributes may be added additional information
  • Properties generally described in the start tag
  • Attributes are always in the form of name / value, such as: name = "value" .

note:

In some rare cases, such as the attribute value itself contains double quotation marks, you must use single quotes, such as: name = 'John "ShotGun" Nelson'

Common attributes:

Attributes description
class (Class name is introduced from the pattern file) to define one or more html element class name (className)
id The only element of the definition of id
style Prescribed elements inline style (inline style)
title It describes additional information element (as the toolbar)

Note

<!-- 这是一个注释 -->

Level

<hr />

Commonly used tags

label description
<html> Custom HTML document
<body> Body definition document
<h1> - <h6> Custom HTML title
<hr> Defined horizontal line
<!--...--> Definition Comment

Change font size

<font size = "1">1号字体文本</font>

HTML output omit redundant spaces

When the display page, the browser will remove extra spaces in the source code and blank lines. All consecutive spaces or blank lines will be counted as a space. Note that all consecutive blank lines in the HTML code (line) is also shown as a blank.

example:

 

发布了277 篇原创文章 · 获赞 289 · 访问量 12万+

Guess you like

Origin blog.csdn.net/qq_41895747/article/details/104243943