HTML Study Notes (1)

HTML (HTML)

Brief introduction

  • Is the standard language used to create web pages
  • HTML is not a programming language, but a tag language

basis

title

<h1>-<h6>来定义

Level

<hr>

Note

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

paragraph

Wrap
<!--段落-->
<p></p>
<!--换行-->
<br>  :    <p>这个<br>段落<br>演示了分行的效果</p>

link

<a href="url">链接文本</a>
Link properties
target

Target can be defined using the linked document is displayed where

<!--target="_blank"使得网址在新的窗口打开-->
<a href="https://www.runoob.com" target="_blank" >swdassd</a>
id attribute
<!--在HTML中插入ID-->
<a id="one">小哥哥,来呀</a>
<!--在HTML中创建一个链接跳到“id=“one””-->
<a href="#one">点点我</a>
<!--从另一个页面创建一个来凝结到id=“one”处-->
<a href="https://www.runoob.com#one">爸爸</a>

image

<img src="" width="" height=""/>

Attributes

Attributes are always in the form of key-value pairs

Commonly used are:

  • defining one or more class class name (className) for the html element (class name is introduced from the pattern file)
  • The only element of the definition of id id
  • style element inline styles provision
  • said additional title information element (used as a tool bar)

HTML Head

head element

It contains all the elements of the head of the label elements. In the elements you can insert scripts (scripts), style file (CSS), and various meta information.

You can add in the head region of the element tag is: ,

the title element

different title tag defines the title of the document.

title in HTML / XHTML document is a must.

base element

base label describes the basic link address / link target, the label as the default link HTML document all links tags:

<head>
		<meta charset="utf-8">
		<title>Title</title>
		<!--没有跳转链接,就默认此方式-->
		<base href="http://www.runoob.com" target="_blank">
</head>

link elements

link tag defines the relationship between documents and external resources.

link tag is typically used to link to the style sheet:

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

style elements

style tag defines the style file HTML documents referenced address.

In the style element you can also directly add style to render an HTML document:

<!--页面颜色-->
<style type="text/css">
			body {background-color:yellow}
			p {color:blue}
</style>

meta element

meta tag describes some basic metadata.

meta tag provides metadata. Metadata is not displayed on the page, but will be parsed by the browser.

Last modified META elements are typically used to specify page description, keywords, file, author, and other metadata.

Metadata can be used in browsers (how to display content or reload page), search engines (keywords), or other Web services.

Use Case

<!--为搜索引擎定义关键词:-->
<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
<!--为网页定义描述内容:-->
<meta name="description" content="免费 Web & 编程 教程">
<!--定义网页作者:-->
<meta name="author" content="Runoob">
<!--每30秒钟刷新当前页面:-->
<meta http-equiv="refresh" content="30">

script elements

script tag to load a script file, such as: JavaScript.

发布了158 篇原创文章 · 获赞 84 · 访问量 7万+

Guess you like

Origin blog.csdn.net/qq_40301026/article/details/104526089