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

Implementation of Docker deployment of MySQL cluster

Disadvantages of single-node database Large-scale...

9 Practical CSS Properties Web Front-end Developers Must Know

1. Rounded Corners Today's web designs are con...

Solve the problem of ifconfig being unavailable in docker

Recently, when I was learning docker, I found tha...

Solution to Ubuntu cannot connect to the network

Effective solution for Ubuntu in virtual machine ...

Detailed tutorial on installing Python 3.8.1 on Linux

This example takes the installation of Python 3.8...

SQL implementation of LeetCode (177. Nth highest salary)

[LeetCode] 177.Nth Highest Salary Write a SQL que...

vue3 timestamp conversion (without using filters)

When vue2 converts timestamps, it generally uses ...

Detailed examples of Docker-compose networks

Today I experimented with the network settings un...

Detailed explanation of how to create an array in JavaScript

Table of contents Creating Arrays in JavaScript U...

Analysis of JavaScript's event loop mechanism

Table of contents Preface: 1. Reasons for the eve...

MySQL establishes efficient index example analysis

This article uses examples to describe how to cre...

How to use Navicat to export and import mysql database

MySql is a data source we use frequently. It is v...

Docker cleaning killer/Docker overlay file takes up too much disk space

[Looking at all the migration files on the Intern...