Detailed explanation of HTML5+CSS3 application
This article mainly introduces the detailed explanation of HTML5 CSS3 application, which has certain reference value. Now I share it with you. Friends in need can refer to it.
Now, HTML5 and CSS3 are eagerly waiting for everyone. Let’s see if they can really take our designs to the next level
Web designers can do some cool stuff using HTML4 and CSS2.1. We can complete the logical structure of documents and create content-rich websites without using the old table-based layout. We can add beautiful and subtle styling to our website without using inline and
tags. In fact, our current design capabilities have taken us far away from that terrible era of browser wars, proprietary protocols, and those ugly web pages filled with flashes, scrolls, and flashes.
Although we have now commonly used HTML4 and CSS2.1, we can do better! We can restructure our code and make our page code more semantic. We can reduce the amount of styling code that gives pages a beautiful look and make them more scalable. Now, HTML5 and CSS3 are eagerly waiting for everyone. Let's see if they can really bring our design to the next level...
In the past, designers often used the software based on The table has no semantic layout. But in the end, thanks to innovators like Jeffrey Zeldman and Eric Meyer, smart designers slowly accepted the relatively more semantic
layout instead of the table layout, and began to call external style sheets. But unfortunately, complex web design requires a lot of different tag structure code, we call it "
-soup" syndrome. Maybe you are familiar with the following code:
Copy code
The code is as follows:
<div class="section"> <div class="article"> <div class="header"> <h1>Div Soup Demonstration</h1> <p>Posted on July 11th, 2009</p> </div> <div class="content"> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> </div> <div class="footer"> <p>Tags: HMTL, code, demo</p> </div> </div> <div class="aside"> <div class="header"> <h1>Tangential Information</h1> </div> <div class="content"> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> </div> <div class="footer"> <p>Tags: HMTL, code, demo</p> </div> </div> </div> </div>
Although this is a bit reluctant, the above example can still illustrate that using HTML4 to code a complex design is still too bloated (in fact, xHTML1.1 is nothing more than that). But what’s exciting is that HTML5 solves the “
-soup” syndrome and gives us a new set of structural elements. These new HTML5 elements have more detailed semantics to replace those meaningless
tags, and at the same time provide "natural" CSS hooks for CSS calls.
The following is an example of an HTML5 solution:
Copy the code
The code is as follows:
<section> <article> <header> <h1>p Soup Demonstration</h1> <p>Posted on July 11th, 2009</p> </header> <section> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> </section> <footer> <p>Tags: HMTL, code, demo</p> </footer> </article> <aside> <header> <h1>Tangential Information</h1> </header> <section> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> <p>Lorem ipsum text blah blah blah.</p> </section> <footer> <p>Tags: HMTL, code, demo</p> </footer> </aside> </section> </section>
As we can see, HTML5 allows us to replace a large number of meaningless
tags with many more semantic structured code tags. This semantic feature not only improves the quality and semantics of our web pages, but also greatly reduces the class and id attributes that must be called for CSS in the code. In fact, CSS3 also allows us to ignore all classes and ids.
Say goodbye to class attributes and welcome neat tags
Combined with HTML5 rich in new semantic tags, CSS3 provides web designers with magic for their web pages. General strength. With the power of HTML5, we will get more control over the document code. With the power of CSS3, our control will become infinite!
Even without those advanced CSS selectors, we can still call different containers through powerful HTML5 clauses without bothering with attributes such as class and id. Like the previous p layout, we may have to call it like this in css: p#news {}
Copy code
The code is as follows:
div.section {} div.article {} div.header {} div.content {} div.footer {} div.aside {}
Let’s take a look at an example based on HTML5: section {}
Copy code
The code is as follows:
article {} header {} footer {} aside {}
This is progress, but there are still some issues that need to be resolved. In the
example, we need to call the element in the page through the class or id attribute. This logic will allow us to apply styles to any element in the document, whether as a whole or individually. For example, in the
example, the .section and .content elements are easy to locate. But in the HTML5 example, there will be many section elements in the actual document. Actually, we could add some specific attribute selectors to call those different section elements, but thankfully, I don't have a few advanced CSS selectors to target different section elements now.
Locating HTML-5 elements without using class and id
Let’s take a look at how to locate an instance of HTML5 page elements without using class and id. We can use three A CSS selector to locate and identify elements within an instance. as follows:
后代选择器:[CSS 2.1]: EF
兄弟选择器:[CSS 2.1]: E + F
子元素选择器:[CSS 2.1]: E > F
下面让我们来看看如何不使用class和id而完成对文档中的那些section元素的定位吧:
定位最外层的
考虑到我们的例子并不是一套完整的HTML5代码,所以我们假定在
元素下有个
Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text
