HTML from scratch (2), 2016 from scratch
1. Layout
① Use the HTML layout of <div> elements. <div> elements are commonly used as layout tools because they can be easily located through CSS.
<! DOCTYPE html>
② Use HTML5 website layout
The new semantic elements provided by HTML5 define different parts of a webpage:
HTML5 semantic elements:
Header |
Define the header of a document or Section |
Nav |
Container that defines the navigation link |
Section |
Define sections in the document |
Article |
Define independent self-contained articles |
Aside |
Define content other than content (for example, sidebar) |
Footer |
Define the footer of a document or Section |
Details |
Define additional details |
Summary |
Define the title of the details Element |
<!DOCTYPE html>
③ Use the HTML layout of the table. <Table> elements are not designed as layout tools. <table> elements are used to display table-based data and use <table> elements to achieve layout effect, because the style of table elements can be set through CSS
Review table: the following code defines a table with one row and one column. <th> it is the header of this row and <td> it is the content of this row, <tr> This line is defined.
<!DOCTYPE html>
2. HTML responsive Web Design
- RWD refers to the Responsive Web Design)
- RWD can transfer web pages in a variable size
- RWD is required for tablets and mobile devices
① One way to create a responsive design is to create it by yourself:
<!DOCTYPE html>
② Using Bootstrap, another method for creating responsive design is to use a ready-made CSS framework. Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive web. Bootstrap helps you develop a site that looks superior in any size: Display, laptop, tablet, or mobile phone:
<!DOCTYPE html>
★Continue to learn about bootstrap later.