Home > Web Front-end > CSS Tutorial > What are the three common ways to write css?

What are the three common ways to write css?

醉折花枝作酒筹
Release: 2023-01-07 11:45:36
Original
5975 people have browsed it

Three commonly used writing methods are: 1. Inline style, syntax ""; 2. Internal style, syntax "Element name {attribute: attribute value;}"; 3. External style, syntax "".

What are the three common ways to write css?

CSS

1.How to use CSS (inline style, internal style, external style)--inline style

    Syntax:

         

2.CSS How to use - internal style

  <head>

  <style>

      p{

      width:100px;
      
      }
  </style>
  </head>
Copy after login

3. How to use CSS - external style

Define the style in external files with the .css suffix, and then reference these files on the page

 

Extended information:

Hyperlink

<a>内容</a>
Copy after login

Note: Only after the href attribute is set, the hyperlink is allowed to be clicked

Attribute:

href=""

General usage:

href="Complete URL"

Special usage:

href="#" Return to top

href="Path to compressed package file" Download this file

href="javascript:js code" Execute this js code

Anchor point

  • Mark the place you want to jump to

##Recommended learning:

css video tutorial

The above is the detailed content of What are the three common ways to write css?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template