Don't forget to close the HTML tag

Don't forget to close the HTML tag
Building web pages that comply with Web standards has always been a topic that jb51.net discusses with everyone. Then, did you remember to close all XHTML elements? Some elements in HTML do not need to be closed. When the next element starts, the previous element is automatically closed. XHTML does not allow this. All elements must be closed, even if they have no content (such as <img>). This kind of page editing conforms to web standards.


mistake:
<li>Item 1
correct:
<li>Item 1</li>

mistake:
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
correct:
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>

mistake:
<br>
correct:
<br />

mistake:
<img src="image.jpg" alt="">
correct:
<img src="image.jpg" alt="" />

Wrong practices should be 100% avoided. As always, always keep all your markers closed.

<<:  jQuery uses the canvas tag to draw the verification code

>>:  A summary of detailed insights on how to import CSS

Recommend

Nginx uses reverse proxy to implement load balancing process analysis

Introduction Based on docker container and docker...

MySQL SQL statement performance tuning simple example

MySQL SQL statement performance tuning simple exa...

Example of how to change the line spacing of HTML table

When using HTML tables, we sometimes need to chan...

MYSQL 5.6 Deployment and monitoring of slave replication

MYSQL 5.6 Deployment and monitoring of slave repl...

Realizing tree-shaped secondary tables based on angular

First look at the effect: Code: 1.html <div cl...

Docker win ping fails container avoidance guide

Using win docker-desktop, I want to connect to co...

How to solve mysql error 10061

This article shares with you the solution to the ...

The difference and usage between div and span

Table of contents 1. Differences and characterist...

Query process and optimization method of (JOIN/ORDER BY) statement in MySQL

The EXPLAIN statement is introduced in MySQL quer...

How to open MySQL binlog log

binlog is a binary log file, which records all my...

React's method of realizing secondary linkage

This article shares the specific code of React to...

About Tomcat combined with Atomikos to implement JTA

Recently, the project switched the environment an...

Mysql solution to improve the efficiency of copying large data tables

Preface This article mainly introduces the releva...

Docker installation rocketMQ tutorial (most detailed)

RocketMQ is a distributed, queue-based messaging ...

H tags should be used reasonably in web page production

HTML tags have special tags to handle the title of...