Objective:
React native development as a new way of mobile development, the individual feel that part of the application needs will be gradually replaced by this way, but also the company mobile developers must master a development technology, so in view of this situation I think it is necessary to learn, hereby write a record of the entire learning process.
What is an HTML file?
- The English full name of HTML is hypertext Marked Language, Chinese is called "Hypertext Markup Language".
- Unlike the general text, an HTML file contains not only textual content, but also some tags, which are called "tokens" in Chinese.
- The suffix name of an HTML file is. htm or. html.
- You can write HTML files with a text editor.
Write a standard HTML first
We use a text editor to declare a index.html and write the following text content
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>This is the title</title></Head><Body>This is the content of the Web page</Body></HTML>
Executing an HTML file is very simple, double-clicking open to use a browser to browse.
Simple explanation:
HTML is based on the text markup language, starting with a <tag>, ending with </tag>.
1.) The content between
2.) The content between <title> and </title> is the title of this file. You can see this title in the title bar at the top of the browser.
3.) The information between <body> and </body> is the text.
About Web page information (META)
In computer language, you can often see a prefix-Meta,meta is the meaning of "about". This meta-explanation is rather awkward, such as metadata, which describes data data, in English, data about data. There is also a word called metalanguage, which represents a language that describes other languages. Another example, metafile, is a file that describes other files.
In HTML, meta tags (meta tags) are used to describe information about a Web page. The sample code is as follows:
<name= "description" content= "header information for HTML Chinese tutorial"> < name= "Author" content= "page author Lee Su Jun">
With the refresh in meta you can also implement the automatic jump page function. Example code:
<http-equiv= "Refresh" content= "5;url=http://www.baidu.com" >
HTML element (HTML Elements)
- HTML elements (HtmlElement) are used to mark text, which represents the contents of the text. Like body, P,title is the HTML element.
- The HTML element is tagged with tag, and tag starts with < and ends with >.
- Tags are usually in pairs, such as <body></body>. The beginning is called Openingtag, and the end is called closing Tag.
- The tag of the current HTML is not case-sensitive. For example,
Attributes of HTML elements (HTML Elements)
HTML elements can have properties. Properties can extend the ability of HTML elements.
For example, you can use a bgcolor property to make the background color of a page red, like this:
<bgcolor= "Red">
For example, you can use the Border property to set a table as a borderless table. As follows:
<border= "0">
Properties are usually paired with property names and values, like this: Name= "value". In the example above, Bgcolor,border is name,red and 0 is value. Property values are generally marked in double quotation marks. The opening property is usually appended to the HTML tag, not the closing tag.
Basic Htmltag
In HTML, the comparison base tag is used primarily for headings, paragraphs and branches.
1.) Body Title
This tab tells you how to define the body headings in the HTML file. HTML uses
<H1Align= "Center"style= "Color:green">This is the H1 title</H1><H2>This is the H2 title</H2><H3>This is the H3 title</H3><h4>This is the H4 title</h4><h5>This is the H5 title</h5><h6>This is the H6 title</h6>
2.) Paragraph Division
Use <p> and </p> to divide paragraphs in HTML.
< P > This is the first paragraph </p><p> This is the second paragraph of the article </ P >
3.) Line break
By using the <br> tag, you can wrap a line without creating a new paragraph. <br> no closing Tag. Using <p> wrapping is a bad habit, and the right thing to do is use <br>.
<style= "Font-size:25pt;color:saddlebrown"> <br>< br > < BR > This is the fourth line in the paragraph </p>
4.) HTML comment
In the HTML file, you can write code comments explaining your code, which will help you and others to better understand your code in the future.
Comments can be written between <!--and. The browser ignores comments, and you don't see your comments in the HTML body.
<!----<p><b> This is just a comment, Does not appear in the Web page </b></p>
HTML Common format
In addition to the above examples of the above-mentioned labels, and today to summarize the usual format tags
1.) Common Text Format tag
- <b> boldface Bold
- <i> Italic Italic
- <del> text underlined to delete
- The <ins> text underline indicates the insertion
- <sub> subscript
- <sup> superscript
- <blockquote> Indent Representation Reference
- <pre> keep spaces and line breaks
- <code> indicates computer code, equal width font
Write segment Demo Code
<P><b>Bold is indicated by B.</b></P><P><I>Italic is indicated by I.</I></P><P><del>I'm going to delete these words.</del></P><P><ins>I'm going to underline these words.</ins></P><P>X<Sub>2</Sub>+y<Sub>2</Sub></P><P>X<sup>2</sup>+y<sup>2</sup></P><P><blockquote>This text needs to be indented</blockquote></P><Pre>Since the default can only have one space, use this to keep multiple spaces</Pre><Code>void Getage () {return age; }</Code>
HTML Special character display
Some characters in the HTML have a special meaning, such as less than the number < is the beginning of the HTML tag, this less than the number is not displayed in the final page we see. What if we want to display a less-than sign in the Web page?
This is about the HTML character entity (HTML Character entities).
A character entity (Character entity) is divided into three parts: the first part is a & symbol, the English name is ampersand; the second part is the entity name or the # plus entity number; The third part is a semicolon.
For example, to display the less than sign, you can write < or & #60;.
The advantage of using the entity name is better understanding, a look at LT, probably guess is lessthan meaning, but its disadvantage is that not all browsers support the latest Entity name. The entity number can be processed by various browsers. Note: Entity is case-sensitive.
1.) How to display spaces
In general, HTML automatically truncates extra spaces. No matter how many spaces you add, it's considered a space. For example, if you add 10 spaces between two characters, the HTML will truncate 9 spaces, leaving only one. To add spaces to the page, you can use to represent spaces.
< Div > < P > Four spaces around each </ P > </ Div >
2.) most commonly used character entities (Character entities)
3.) Other commonly used character entities (Character entities)
Summarize:
This article first briefly summarizes the simple use of HTML, the next one to learn about the use of other HTML tags.
HTML Basics of Reactnative Learning