If you know nothing about html and are still worried about how to get started with html, the author recommends that you learn this article, which can quickly master html. If you are already an expert in html, I hope you can give me better suggestions.
summaryHTML is commonly known as the hypertext markup language. It is an abbreviation of Hyper TextMarkup Language. It is a markup language used to describe web documents. The web page file itself is just a text file. By adding markers to the text file, we can tell the browser how to display the content (such as: how to process text, how to arrange the picture, how to display the picture, etc.). These markers are our html. When we learn html, we learn these markers. Today we mainly learn some common html markers, also known as html elements.
Tag elementsTag introduction
The html element includes a range of inclusions defined by one or a pair of tags. A tag is composed of two strings < and > signs, and the tag includes the start tag <> and the end tag</>.
There are four forms of html tag elements:
Empty element:<br>
Empty element with attribute: <hrfont=red>
Elements with content: <titile>This is content</titile>
Elements with content and attributes: <fontcolor=red>This is content</font>
One thing to say here is that in the html document, the names of tags and attributes are not related to size.
Essential Elements of HTML Framework<html></html> means the beginning and end of the document
<head></head> means the beginning and end of the document header
<title></title> indicates the beginning and end of the document title
<body></body> indicates the beginning and end of the document's body text
html comment
The format is less than the sign (<), the exclamation mark (!) less than the sign and the exclamation mark have no spaces. Next are two short lines (-), then the comment content, and finally two short lines (-) and greater than the sign (>).
For example: <!--This is the comment content-->
Tags related to paragraph control<palign=#>
Create a paragraph, the attribute align indicates the alignment of the paragraph, # can be left, center, right, justify.
<br>
The function is to change the line
<hrcolor=#>
The function is to insert a horizontal line, and the property color is used to represent the color.
Tags related to text display<center>…</center>
Center the text
<hnalign=#></hn>
The function is to represent the title of the document. n is an integer from 1 to 6, the largest title at one time, 6 is the smallest title, and align is to set the title alignment, including left, center, and right
<fontsize=n color=#>...</font>
Set the font, size is the font size, an integer from 1 to 7, the larger the number, the larger the font.
<b>...</b>
Make the text bold.
<i>…</i>
Make the text italic
Tags created by list elementsa. Create a list with numeric numbers:
<ol>...</ol>Use the start attribute to set the starting sequence number.
<li>...</li>Use the value attribute to change the sequence number order in the list.
b. Create a list with project conforming:
<ul> and <li>, their tag's type attributes specify the style of the symbol:
disc, displayed as a solid circle;
square, displays unsolid squares.
circle, display unopened circles
b. Create an unsigned list
<dl> and <dt> tags create unsigned lists
<dd> and <dt>, create an indented list
Tags for table elementsThe role of tables in web page layout is crucial, and tables are defined by <table>.
The specific definition is: <tableborder=n aligh=# bgcolor=rgb>
The attribute border is used to define the width of the table border, and the attribute align is used to set the alignment of the table, which can be left, right, and center. bgcolor is color.
<caption>…</caption> used to define the title of the table
<tr>...</tr>Add a new row to the table
<th>…</th> is used to define the table header
<td>…</td> is used to define cells
html interactive formForms are mainly responsible for data collection functions in web pages. For example, the form is the one that we usually register information and input information that can interact with web pages.
The form is created using the <form>...</form> element, embedding other related elements or controls between the two, you can create a form that is part of the html document.
The basic syntax for creating a form is as follows:
<formmethod=get or post action=URL>….</form>
The attribute method is used to specify the HTTP method used to send form data to the server. It can be done with get or post. The submitted data is attached to the end of the URL and sent to the server as part of the URL.
Here are some common elements about forms:
The <input> element is used to receive user input information. It is an empty element with attributes. The syntax is used to create the control in the form.
<inputtype=type name=name size=sizevalue=value'>
The attribute type is used to specify the type of the control to be created, the attribute is used to specify the name of the control, the size is used to specify the initial width of the control in the form, and the attribute value specifies the initial value of the control.
For the type type, please refer to the following picture:
List box elementsAllows the user to select one or more items from a drop-down menu. The list box is created by the <select> element and the options in the list box are provided with the <option> element.
Multi-line text input control
<textareaname=name rows=number of rows cols=number of columns >…</textarea>
Attribute rows is used to specify the number of text lines displayed in the visual area of the text box input control, and cols specifies the width of the visual area displayed in the text input control.
Hyperlink tags<ahref=URL>…</a>
The attribute href is used to specify the target of the link. The destination address has URL positioning. The text between the start tag <a></a> will be used as the link text displayed in the browser.
Embed image tags <img src=URL width=n height=m> Attributes src specify the location of the image resource. The properties width and height are used to specify the size of the image. It should be noted here that src should try to use relative paths instead of absolute paths.Special character elements
Special characters include character references and entity references. Below we will summarize the commonly used ones.
SummarizeWe have summarized some of the most used and most basic tag elements. Once you master these most basic ones, you can quickly become a junior html. It is no problem to write a simple html web page, which also lays the foundation for further learning in the future.