Today is my third day studying at LeByte

Today is the third day of my study in LeByte Education. Today’s main content is dic, span, formatting tags and a tags of HTML and CSS.

div and span

div

​ <div> is a block-level element, usually used in conjunction with css for layout.

​ The <div> tag can divide the document into independent and different parts. It can be used as a strict organization tool and does not use any format associated with it.

​ <div> is a block-level element. This means that its content automatically starts a new line. In fact, line wrapping is the only formatting inherent in <div>. Additional styles can be applied via the class or id of the <div>.

<div>content</div>

Common attributes

Attributes value description
align left、right、center Specifies the alignment of the content in the div element, which can be replaced by styles in the future
span

​ The <span> tag is used to combine inline elements in the document, and span has no fixed format. When a style is applied to it, it will make a visual change.

<span>content</span>

Formatting tags

font

​ Specify the font, font size, and font color of the text

pre

​ Define pre-formatted text. The text enclosed in the pre element usually retains spaces and newlines. And the text will also be rendered in monospace font

Text label
**<b>**(粗文本)、**<i>**(斜体文本)、**<u>**(下划线文本)、 

<Del> (underlined text), <Sub> (subscript text), <SUP> (superscript text)

a tag

​ The <a> tag defines a hyperlink, which is used to link from one page to another.

​ The most important attribute of the <a> element is the href attribute, which indicates the target location of the link. At the same time, there is no href attribute. The content in the a tag is no different from ordinary text, and the hyperlink function is lost.

​ If you want to jump to the current page, then the value of href is #. The linked page is usually displayed in the current browser window, unless you specify another target (target attribute).

<a href="http://www.baidu.com">百度</a>

Common attributes

Attributes value description
href URL The location where the connection will jump may be another or current page.
target _blank<br>_parent<br> self <br>top<br>Framename as the name value of the a tag of the anchor Specifies where to open the linked document. <br>_blank: open a new page to display the page; <br>_self: the current page displays to jump to the page, the default value. <br>_top: Used for pages with frameset layout, and want to cover the entire page display. <br>Framename: The framename here is different from the value above. The specific name of the frame shall prevail. This value indicates that the page to be connected will be displayed in the frame of the corresponding name after the jump.

Anchor point realization

​ Use the name attribute of the a tag:

<a name="top"></a>

​ The id attributes of general tags: div id="", a id="", etc.:

<div id="top"></div>、<a id="top"></a>

​ Anchor point positioning

<a href="#top">返回首部</a>

Time flies so fast, today’s study time is coming to an end, sleep well tonight and get ready for tomorrow’s study!

Guess you like

Origin blog.51cto.com/14965638/2542789