Chapter 1, Building Blocks of Web Pages
The web page mainly consists of three parts:
1. Text content (plain text)
2. References to other files: images, audio, videos, style sheet files, js files
3. Markup: Describe the text content and ensure that citations work correctly
NOTE: All these components are composed of text only
Basic HTML page
HTML uses < ,> to surround HTML tags. The opening tag (such as <head>) marks the beginning of the element, and the closing tag (</head>) is used to mark the end of the element
Page top and header
<body>The content above the opening tag is prepared for browsers and search engines. The <!DOCTYPE html> part tells the browser that this is an HTML5 page.
Note: DOCTYPE should always be located on the first line of the page
Next is the <html> element, which contains the rest of the page. Next is the <head> document header, <meta>, <title> are at the document head.
Tags: elements, attributes, values, and other
Tag composition: element, attribute, value
Note: It is customary to use lowercase letters
for labels
Note: The quotation marks around the attribute value are optional. It is recommended to write them. Try to use lowercase letters to write the attribute name
Parent element, child element
If an element contains another element, it is the parent element of the contained element, and the contained element is called a child element.
Note: Be sure to nest correctly, for example:
<div> <p></p> </div>
You cannot nest as follows, problems will occur
Statement:
All resources on this website are contributed and published by netizens, or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this website are for learning and reference only. Please do not use them for commercial purposes, otherwise you will be responsible for all consequences incurred! If there is any infringement, please contact us to delete and remove it. Contact information: admin@php.cn