Common tags in XHTML

Common tags in XHTML

What are XHTML tags?
XHTML tag elements are the basic components of XHTML documents. XHTML tags can be understood as tags used by the XHTML language to define what "this is, what that is" in an XHTML document.
XHTML tags are keywords surrounded by angle brackets and often appear in pairs, such as <html></html>. This tag indicates that this is an HML (XHTML) document. The first tag in a tag pair is the start tag and the second tag is the end tag.
There are also a few tags that are not paired or have no ending tag, such as the line break tag <br />.
Closing XHTML Tags In the XHTML specification, all tags must be closed. Usually paired tags are closed with an end tag, and unpaired tags are closed with a space plus />, such as <br />.
Although browsers can recognize unclosed tags, closing tags is required from the specification and in the long run.

Commonly used XHTML tags
<html></html> tags
This tag indicates that this is an hmtl (xhtml) document. Except for the XHTML file type declaration, all other XHTML tag elements must be embedded in this tag.

XML/HTML CodeCopy content to clipboard
  1. < html >   
  2. < head > ... </ head >   
  3. < body >   
  4. < p > Text paragraphs and other text content </ p >   
  5. </ body >   
  6. </ html >   

<head></head> tag
<head></head> indicates the header information of the XHTML document, which is usually required by the browser and contains additional instructions for the XHTML document, such as CSS styles or other script information loaded by the document.

<title></title> tag
This tag defines the title of the entire XHTML document and is used to display in the title bar at the top of the browser window. The tag is nested in <head></head>.

XML/HTML CodeCopy content to clipboard
  1. < head >   
  2. < title > XHTML Tags - XHTML Tutorial </ title >   
  3. </ head >   
  4. The < body > </ body > tag

As the name implies, this tag describes the main content of the XHTML document. All the main content that needs to be displayed is included in this tag.

XHTML Title
XHTML document titles are divided into 6 levels, defined by <h1> - <h6> respectively.

XML/HTML CodeCopy content to clipboard
  1. < h1 > First level title </ h1 >   
  2. < h1 > Second level title </ h1 >   
  3. < h1 > Level 3 title </ h1 >   

Note that this is not the title, but usually <h1> is equivalent to <title> in its core.

XHTML Paragraphs
XHTML paragraphs are defined by the <p></p> tags:

XML/HTML CodeCopy content to clipboard
  1. < p > This is a paragraph </ p >   

XHTML Hyperlinks
XHTML hyperlinks are defined by the <a></a> tags:

XML/HTML CodeCopy content to clipboard
  1. <   href = "https://www.jb51.net" > 5iDev Web Development Online Tutorial </ a >   

XHTML Images
XHTML images are defined using the <img> tag:

XML/HTML CodeCopy content to clipboard
  1. < img   src = "flower.jpg"   alt = "flower"   />   

In this tag, the image source is provided as src attribute, and this tag will display the flower.jpg image in the browser.

XHTML forms
XHTML forms are used to collect user input information, such as user messages, etc. The form is defined by <form></form>:

XML/HTML CodeCopy content to clipboard
  1. < form >   
  2. Various form elements (text fields, drop-down lists, radio buttons, check boxes, etc.)
  3. </ form >   

<<:  Centos6.5 glibc upgrade process introduction

>>:  MySQL example to explain single-row functions and character math date process control

Recommend

Example of making a butterfly flapping its wings with pure CSS3

Pure CSS3 makes a butterfly flapping its wings, s...

Comparative Analysis of UI Applications of Image Social Networking Sites (Figure)

In our life, work and study, social networks have ...

Implementation of drawing audio waveform with wavesurfer.js

1. View the renderings Select forward: Select bac...

Parse CSS to extract image theme color function (tips)

background It all started when a classmate in the...

Add ?v= version number after js or css to prevent browser caching

Copy code The code is as follows: <span style=...

Detailed explanation of custom swiper component in JavaScript

Table of contents Effect display Component Settin...

Pure HTML+CSS to achieve typing effect

This article mainly introduces the typing effect ...

Example code for hiding element scrollbars using CSS

How can I hide the scrollbars while still being a...

How to use an image button as a reset form button

When we make a form, we often set a submit button ...

js dynamically implements table addition and deletion operations

This article example shares the specific code for...

How to use CSS style to vertically center the font in the table

The method of using CSS style to vertically cente...

The DOCTYPE mode selection mechanism of well-known browsers

Document Scope This article covers mode switching...

Centos7 installation of FFmpeg audio/video tool simple document

ffmpeg is a very powerful audio and video process...