Detailed explanation of HTML style tags and related CSS references

Detailed explanation of HTML style tags and related CSS references

HTML style tag

style tag - Use this tag when declaring styles in a document
Style tags appear in pairs, starting with <style> and ending with </style>
media -- media type,

type -- contains the type of content, usually type="text/css"
Example

XML/HTML CodeCopy content to clipboard
  1. < head >   
  2.      < style   type = "text/css" >   
  3. abbr
  4. {
  5. font-size: 12px;
  6. }
  7. .text10pxwhite
  8. {
  9. font-size: 10px;
  10. color: #FFFFFF;
  11. }
  12.      </ style >   
  13. </ head >   

Internal CSS

You can use the style tag to load the content of the CSS file directly into the HTML document.

Example

CSS CodeCopy content to clipboard
  1. <style type= "text/css" ><![CDATA[
  2. /* ----------Beginning of text style---------- */   
  3.   
  4. /* Dream City white 12 pixel text */   
  5. .dreamduwhite 12px   
  6. {
  7.      color : white ;
  8.      font-size : 12px ;
  9. }
  10. /* Dream City black 16 pixel text */   
  11. .dreamdublack 16px   
  12. {
  13.      color : black ;
  14.      font-size : 16px ;
  15. }
  16.   
  17. /* ----------End of text style---------- */   
  18. ]]></style>

<<:  Solution to Mysql binlog log file being too large

>>:  Discussion on image path issues in css (same package/different package)

Recommend

Vue3 implements Message component example

Table of contents Component Design Defining the f...

Implementation of built-in modules and custom modules in Node.js

1. Commonjs Commonjs is a custom module in nodejs...

Method for realizing Internet interconnection by VMware virtual machine bridging

After installing VMware and creating a new virtua...

Introduction to Docker Architecture

Docker includes three basic concepts: Image: A Do...

How to completely uninstall node and npm on mac

npm uninstall sudo npm uninstall npm -g If you en...

Professional and non-professional web design

First of all, the formation of web page style main...

The use of setState in React and the use of synchronous and asynchronous

In react, if you modify the state directly using ...

Vue-pdf implements online preview of PDF files

Preface In most projects, you will encounter onli...

Detailed installation steps for MySQL 8.0.11

This article shares the installation steps of MyS...

How to check if the firewall is turned off in Linux

1. Service method Check the firewall status: [roo...

Teach you step by step to develop a brick-breaking game with vue3

Preface I wrote a few examples using vue3, and I ...

How to extract string elements from non-fixed positions in MySQL

Preface Note: The test database version is MySQL ...