1. Introduction to HTML
1) What is HTML:
Hypertext Markup Language: Hypertext Markup Language, Web language.
Hypertext: Out of range of text.
Tag: All operations in HTML are implemented using tags, labeled,< tag names >
"Web language:
2) Create the file:
"We create a Java file with a. java suffix named.
By compiling and then using the JVM to run
"The HTML suffix is:. html,.htm
Run directly with the browser
"HTML code example:
This is my <font. size= "5" color= "Green" > First HTML program </font>
The specification of HTML
(1) the start and end tags of an HTML range
(2) The HTML language consists of two parts:
<body> content displayed on the page is written in body </body>
(3) The HTML tag has a start tag and an end tag.
(4) HTML code is case-insensitive
(5) Some labels do not have an end tag, they should end inside the label
such as: line break: <br/>
Horizontal line: Photo:
The idea of HTML writing:
The page has a lot of data, different data may need different display effect, this time it will need to use the tag we want to operate
The data is encapsulated, then the tag attribute values are modified to change the properties of the internal data.
A label is equivalent to a container, we want to change the data style inside the container, only need to change the container's property value, we can realize the change of the container internal data
2. Text label and comment label
1) Text label: In order to modify the style of the text
-<font> </font>
Properties
*size: The size of the text, the value range: 1~7 (out of range default boundary value).
*color: Text color
-Two ways of expression:
* * English word: red, Green,blue,yellow,black,white,gray
* * used in hexadecimal: #ffffff: RGB
Generally use the tool to select different colors.
2) Note Tags: used in order to annotate in code (not displayed in Web pages)
-Analogy Java annotations (three types)
-html Comment: <!--HTML comment content--
3. Title tag, horizontal line label and special character
1) title tag:
Indicates that the label font size is smaller in turn and wraps automatically.
2) Horizontal line label:
-Properties
Size: The thickness of the horizontal line (the specification is the same as the property specification of the text label)
Color of the horizontal line (the specification is the same as the property specification of the text label)
-Code Demo:
<HR size= "5" color= "Red"/>
3) Special character Tags:
-To display some of the default symbols used by HTML syntax in the program: < or > in
-Similar to the escape character in a string in Java.
List commonly used several, (other find HTML Help documents):
< <
> >
& &
Space
4. List label
1), indent list label:
<dl> </dl>: Indicates the scope of the list
Inside the DL:<dt> </dt>: Top Content
Inside the DL:<dd> </dd>: Lower content
Code:
<dl>
<dt> Chinese People </dt>
<dd> Han </dd>
<dd> Hui </dd>
<dd> Miao </dd>
</dl>
Display effect:
Chinese nation
Han
Hui
Miao
2) ordered list label
<ol> <ol>: Sequence List range
Property: Type: Set sort by 1 (default) a I
In the OL label <li> content </li>
Code:
<ol>
<li> Han </li>
<li> Hui </li>
<li> Miao </li>
</ol>
<ol type= "a" >
<li> Han </li>
<li> Hui </li>
<li> Miao </li>
</ol>
Display effect:
1. Han Nationality
2. The Hui
3. Miao Nationality
A. Han nationality
B. The Hui
C. Miao Nationality
3) unordered list label:
<ul> </ul>: Range of unordered lists
Properties: Type: Hollow Circle Circle, Solid circle disc (default), Solid square Square
Inside UL: <li> specific content <li>
Code:
<ul>
<li> Han </li>
<li> Hui </li>
<li> Miao </li>
</ul>
<ul type= "Circle" >
<li> Han </li>
<li> Hui </li>
<li> Miao </li>
</ul>
Display effect:
Solid Circle Han
Solid Circle Hui
Solid round Miao
Hollow Circle Han
Hollow Circle Hui
Hollow Round Miao
5. Image label (emphasis)
Note: The label does not have an end tag and is closed within the label.
Property:
SRC: path to Picture
Width: breadth of picture
Height: altitude of picture
Alt: Text displayed on the picture (you need to move the mouse to the image for a moment to display it (or to display the text hint when the picture is wrong))
However, some browsers do not support this effect.
6. Path Introduction (emphasis)
* Paths are divided into two types: absolute and Relative
* * Absolute path:
--d:\java\work\a.pmg
--http://www.baidu.com./b.jpg
* * Relative path:
--refers to the location of a file relative to another file.
--there are generally three kinds:
* * file in the same directory of HTML, you can write the file name directly
--
* * file in the lower directory of HTML
Use the a.jpg in the XX folder in HTML
----D:\java\work\ demo.html
----D:\java\work\ xx\a.jpg
--
* * file in the upper-level directory of HTML
Using a.jpg in the Java folder in HTML
----D:\java\ work\demo.html
----D:\java\ a.jpg
--
7. Hyperlink tag (Important)
1), Connect resources:
--<a href= "Connect to a resource's path" > content displayed on a Web page </a>
Property:
HREF: The resource address of the connection
Target: Set open mode, default true current page
---_blank: Opens in a new window.
---_self: Opens on the current page.
2), locate resources:
(1) If you want to locate a resource, you must first define a location:
<a name = "Top" > Top </a>.
(2) return to this position
<a href= "#top" > Back to Top </a>
(3): Introduce a label pre: output as-is.
9. Table Label
Role: Data can be formatted to make the data display clearer.
Label:
1), <table> </table>: Indicates the scope of the table.
Property:
--border: Whether the table lines are displayed, and how thick the display is.
--bordercolor: The color of the table line.
--cellspacing: The distance between cell lines.
--width: The width of the table.
--height: The height of the table.
2), define line:<tr> in table </tr>
Property:
--Set alignment: Align:left, center, right
3.1), set cell in TR 1: <td> </td>
Property:
--Set alignment: Align:left, center, right
3.2), set cell in TR 2: <th> </th>
Its own implementation of the various data center bold format.
4), the title of the table: <caption> </caption>
5), Merge cells
--rowspan: Cross-row (collapsed on cell properties: <TD rowspan= "3" > </td>)
--colspan: Cross-column (collapsed at line property: <td colspan= "3" > </td>)
Analysis:
--First, define the scope of a table using table
--second, define a line using TR
--again, define a cell using TD or TH
When you do this, you should determine the number of rows in the table before you determine the cell for each row.
code example:
< table border= "1" bordercoloer= "yellow" cellspacing= "0" width= "all" height= "+" >
<tr align= "Left" >
<td> </td> <td> </td> <td> </td>
</tr>
<tr>
<th> </th> <th> </th> <th> </th>
</tr>
</table>
9. Form label (Heavy)
is a label that can submit data to the server (such as a registration page)
1), <form> </form>: Defines the scope of a form
--Properties
--action: The address submitted to, by default, is submitted to the current page.
Value is: one address.
--method: How forms are submitted
-There are two common types: Get (default) and post
The difference between get and post:
(1): The GET request Address bar will carry the submitted data, Post will not (in the HTTP protocol in detail)
(2): Get request Security is low, post is higher.
(3): The GET Request data size is limited, post is not.
--enctype: Use when uploading files (later, to supplement this blog content)
2), Input: You can enter the content or select the part of the content
--Most entries use <input type= "type of input item"/>
A name attribute is required in these entries to be committed.
--General input: <input type= "text"/>
--Password entry: <input type= "Password"/>
--Single input entry: <input type= "Radio"/>
---need the name attribute inside.
---The name value must be the same between the radio entries that you want to associate.
---must have a value.
---Add properties to the option to implement the default check:
Checked= "Checked"
--Check entry: <input type= "checkbox"/>
---need the name attribute inside.
The name value must be the same between the check entries---to be associated.
---must have a value.
---Add properties to the option to implement the default check:
Checked= "Checked"
--File entry (after learning in the supplement)
<input type= "File"/>
--drop-down input option (this tag is not in the Input tab)
Such as:
<select name= "Birth" >
<option value= "1991" >1991</option>
<option value= "1992" >1992</option>
<option value= "1993" >1993</option>
</select>
--Add attributes to the default options:
Selected= "Selected"
--Text field
<textarea cols= "Ten" rows= "ten" ></textarea>
--Hidden items (not displayed on the page, but in the HIML code)
<input type= "hidden"/>
--Submit button
<input type= "Submit"/>
<input type= "Submit" value= "the character to be displayed on the button"/>
(after submission, the data is passed using the Name=value class key-value pair method)
--Submit using a picture as a button
<input type= "image" src= "PicturePath"/>
--reset button (will go to the initial state of the entry)
<input type= "Reset"/>
--Normal button (requires event monitoring, often and JS simultaneous use)
<input type= "button" value= "the character to be displayed on the button"/>
10. Other common tags in html
<b></b>: Bold
<s></s>: Delete Line
<u></u>: Underline
<i></i>: Italic
<p></p>: Paragraph label (more than one row of BR tags)
<pre></pre>: Output AS-is
<sub></sub>: Subscript
<sup></sup>: Superscript
<div></div>: Wrap Line
<span></span>: Display on one line
11. Use of header tags in html
The HTML is divided into the head and body parts, and the header tag used in the head
<title> </title>: Indicates what is displayed on the label.
<meta/> Tags: set up some related content of the page
<meta name= "Keyword" content= "word1, Word2 ..." />: Set Page keywords
<meta http-equiv= "Refresh" content= "Wait seconds, url= Web address"/>: Timed refresh jump.
<base/> Tags: Set the basic settings of the hyperlink, you can set all the hyperlinks in the page to open the way (this page or another open)
<base target= "_blank"/>
<link/> Tags: introduce external files.
such as the introduction of CSS Files
12, frame label (more outdated, generally less use, to master the usage can be)
* <frameset> </frameset>
--rows: Dividing by line
such as: <frameset rows= "80,*" > </frameset>
--cols: Partitioning by column
such as: <frameset cols= "80,*" > </frameset>
*<frame></frame>
--specific pages displayed
For example: <frame name= "displayed page title" src= "page address" > </frame>
Note: When using frame label, cannot write in body, use frame label, need to remove body.
An example of a partition:
<frameset rows= "80,*" >//divides the page into two parts
<frame name= "Top" src= "a.html" >//Setting the page shown in the above section
<frameset cols= "150,*" >//the following pages into the left and right two parts
<frame name= "Lower_left" src= "b.html" >//settings left page display page
<frame name= "Lower_right" src= "c.html" >//set the page displayed on the right page
</frameset>
</frameset >
If the hyperlink on the left, want the content to appear on the right page
--Set the page properties in the hyperlink to the name of the page on the right.
--<a href= "hyperlink open page name" target= "right" > Hyperlink 1</a>
Simple Learning notes for HTML