search
HomeWeb Front-endHTML TutorialDetailed introduction to HTML tags, selectors, hyperlinks and SEO

Common tags:

block

The img tag is a single tag alt function. The image fails to load and displays the content in the alt

Detailed introduction of a tag:

Link implementation of a tag:

a tag Clicking the a tag

will go to the corresponding link to control the link to open a new page or other target, as well as self and other

him;

Write in the head section; the default page opening method for all links

, if there are some people in the body section For the target attribute, the target attribute in the a tag in the body part is

first;

The download implementation of the a tag: Put in the things to be downloaded Use

# inside to implement the download function

The anchor point implementation of the a tag: (a Anchor) Baibu Fei

The title tag is not one but a group of six:

> ;

Paragraph tag Use p tag for a paragraph

< ;p/>

Emphasis tag strong The page is displayed in bold by default

Content (Content)

Also The effect of emphasis is not as important as the tone of the strong tag. The default display is italic

span tag

distinguishes styles, a paragraph of text or content style distinguishes

Conten

List

Ordered List

  1. (List Item)< ;/li>

No list required

  • (list item) li>

Definition list

Definition list title

Define list items

SEO: Search engine optimization For example: Baidu wait

Function: There is a crawler program that searches for information every day and saves it.

Advantages of tags:

Semantic page tags;

Using tags that are beneficial to SEO; h1; h2; h3;strong;em accounts for about 7% or 8%. Reasonable optimization

Do not overuse

Increase page keyword density;

id selector

#box1,box2{

width:100px;height:100px;background:red;

}

Group selector # followed by id+","+ A group of id uses the same style

.box(id) and the use of class class is a class, which can be understood as an id that can be used repeatedly

;

class selector can be followed by multiple styles

Type selector tag name {}

Inclusion selector: Select according to the inclusion relationship in the page

div p{ } represents all p tags in the div tag

Wildcard character

*{border:1px solid red;} All in the page have this format and are basically useless

Selector Priority:

Prerequisites at the same level: The style defaults to the latter overriding the former

The higher the inclusion level, the style will use which

class style selector

The order of calling names at the same level does not matter, only the order of styles

Type (1)

(javaScrapt)

Compare style priorities and judge based on the number of highest style priorities

Do not write too deep inclusion relationships during work

Pseudo-class of a:

link not visited

hover mouse hover (mouse across)

active link activation

visited after visit

Written in style

a:link{}

a:hover{}

Pseudo class sequence link visited hover active

Application: Search engine novels, etc.

div pseudo-class: hover Most tags support hover

IE6 does not support a pseudo-class of any other tags

Supported by IE6 and above

The above is the detailed content of Detailed introduction to HTML tags, selectors, hyperlinks and SEO. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the purpose of the <progress> element?What is the purpose of the <progress> element?Mar 21, 2025 pm 12:34 PM

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

What is the purpose of the <datalist> element?What is the purpose of the <datalist> element?Mar 21, 2025 pm 12:33 PM

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element?What is the purpose of the <meter> element?Mar 21, 2025 pm 12:35 PM

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

What are the best practices for cross-browser compatibility in HTML5?What are the best practices for cross-browser compatibility in HTML5?Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

What is the viewport meta tag? Why is it important for responsive design?What is the viewport meta tag? Why is it important for responsive design?Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

How do I use the HTML5 <time> element to represent dates and times semantically?How do I use the HTML5 <time> element to represent dates and times semantically?Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

How do I use HTML5 form validation attributes to validate user input?How do I use HTML5 form validation attributes to validate user input?Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What is the purpose of the <iframe> tag? What are the security considerations when using it?What is the purpose of the <iframe> tag? What are the security considerations when using it?Mar 20, 2025 pm 06:05 PM

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor