Home Web Front-end HTML Tutorial HTML study notes 2

HTML study notes 2

Apr 19, 2018 pm 02:32 PM
html study notes


The content of this article is about HTML learning notes 2. It has a certain reference value. Now I share it with you. Friends in need can refer to it

1 , table<table>

&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;
&lt;td&gt;row 1, cell 1&lt;/td&gt;
&lt;td&gt;row 1, cell 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;row 2, cell 1&lt;/td&gt;
&lt;td&gt;row 2, cell 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
Copy after login

<tr>......</tr>define rows, <td>......</td>define columns

Header represents:

&lt;tr&gt;
&lt;th&gt;heading&lt;/th&gt;
&lt;/tr&gt;
Copy after login

If you want to represent a blank line, you can fill it with  space placeholder.


2. List



##First type: None Sequence listing - <ul>, use bold dot mark

&lt;ul&gt;
&lt;li&gt;Coffee&lt;/li&gt;
&lt;li&gt;Milk&lt;/li&gt;
&lt;/ul&gt;
Copy after login


or use <ul type="circle">...use an open circle point.


##Second type: Ordered list——<ol>, use numbers to mark

&lt;ol&gt;
&lt;li&gt;Coffee&lt;/li&gt;
&lt;li&gt;Milk&lt;/li&gt;
&lt;/ol&gt;
Copy after login


Or use <ol start="50">... to indicate that the number starts from 50.



##Third type: Custom list——<dl>

&lt;dl&gt;
&lt;dt&gt;Coffee&lt;/dt&gt;
&lt;dd&gt;Black hot drink&lt;/dd&gt;
&lt;dt&gt;Milk&lt;/dt&gt;
&lt;dd&gt;White cold drink&lt;/dd&gt;
&lt;/dl&gt;
Copy after login

Explanation:

<dl> indicates the beginning of the list



##<dt>Indicates list items


<dd>Indicates the definition of list items


## Note that paragraphs, line breaks, pictures, links, other lists, etc. can be used inside list items.




3. HTML class

Classifies HTML and can An element's class defines the CSS style.


Set the same style for the same class.

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
.cities {
    background-color:black;
    color:white;
    margin:20px;
    padding:20px;
} 
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;p class=&quot;cities&quot;&gt;
&lt;h2&gt;London&lt;/h2&gt;
&lt;p&gt;
London is the capital city of England. 
It is the most populous city in the United Kingdom, 
with a metropolitan area of over 13 million inhabitants.
&lt;/p&gt;
&lt;/p&gt; 

&lt;/body&gt;
&lt;/html&gt;
Copy after login



#< ;p> is a block-level element used to set the same class.
<span> is an inline element.

&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
  span.red {color:red;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;My &lt;span class=&quot;red&quot;&gt;Important&lt;/span&gt; Heading&lt;/h1&gt;

&lt;/body&gt;
&lt;/html&gt;
Copy after login


4. HTML website layout

(1) Use <p> for layout


&lt;head&gt;
&lt;style&gt;
#header {
    background-color:black;
    color:white;
    text-align:center;
    padding:5px;
}
#nav {
    line-height:30px;
    background-color:#eeeeee;
    height:300px;
    width:100px;
    float:left;
    padding:5px;	      
}
#section {
    width:350px;
    float:left;
    padding:10px;	 	 
}
#footer {
    background-color:black;
    color:white;
    clear:both;
    text-align:center;
   padding:5px;	 	 
}
&lt;/style&gt;
&lt;/head&gt;
Copy after login

Use<p id="header">......</p>

(2) HTML5 Provided new semantic elements



<header>Defines the header of a document or section

< ;nav>Define a container for navigation links


##<section>Define a section in a document


<article> ;Define independent self-contained articles


##<aside>Defining content other than content (sidebar) (? Not done yet Be clear about what this is)

<footer>Define the footer of a document or section


##<details> Define additional details

<summary>Define the title of the details element



##5. Frames


By using frames, more than one page can be displayed in the same browser window. Each HTML document becomes a frame, and each frame is independent of other frames.



## (1) Frame structure tag <frameset>

Each <frameset> defines a series of columns Rows and columns



The value of rows/columns specifies the area of ​​the screen occupied by each row or column

&lt;frameset cols=&quot;25%,75%&quot;&gt;
   &lt;frame src=&quot;frame_a.htm&quot;&gt;
   &lt;frame src=&quot;frame_b.htm&quot;&gt;
&lt;/frameset&gt;
Copy after login

(2) Others

Generally, a frame has a visible border, and the user can drag the border to change its size. If you want to avoid it, you can add noresize="noresize" to <frame>.



#The <body> tag and the <frameset> tag cannot be used at the same time. However, when adding a <noframes> tag that contains a piece of text, the text must be nested within the <body> tag.

&lt;html&gt;

&lt;frameset cols=&quot;25%,50%,25%&quot;&gt;
  &lt;frame src=&quot;/example/html/frame_a.html&quot;&gt;
  &lt;frame src=&quot;/example/html/frame_b.html&quot;&gt;
  &lt;frame src=&quot;/example/html/frame_c.html&quot;&gt;

&lt;noframes&gt;
&lt;body&gt;您的浏览器无法处理框架!&lt;/body&gt;
&lt;/noframes&gt;

&lt;/frameset&gt;
&lt;/html&gt;
Copy after login

<frame>You can use the name anchor attribute to jump to the specified section.




##<iframe>Used to display web pages within web pages

Usage:<iframe src ="URL" width="200" height="200" frameborder="0"></iframe>



iframe可用作链接的目标(target),该链接的target属性必须引用iframe的name属性。

&lt;iframe src=&quot;demo_iframe.htm&quot; name=&quot;iframe_a&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;a href=&quot;http://www.w3school.com.cn&quot; target=&quot;iframe_a&quot;&gt;W3School.com.cn&lt;/a&gt;&lt;/p&gt;
Copy after login


注意,由于链接的目标匹配iframe的名称,所以链接会在iframe中打开。

相关推荐:

HTML学习笔记一

The above is the detailed content of HTML study notes 2. For more information, please follow other related articles on the PHP Chinese website!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

Nested Table in HTML

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Table Border in HTML

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

HTML margin-left

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

HTML Table Layout

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Moving Text in HTML

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

HTML Ordered List

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

How do you parse and process HTML/XML in PHP?

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

HTML onclick Button

See all articles