css declare variables define common style values

tags: Native distal technology: css  front end  css  less  sass  Declare variables

grammar:

  1. With-- At the beginning of the definition of a variable name
  2. use var() Call variable values

1. Global variables:

Use:root Selector declare global variables
: root root element selector for matching documents (HTML tag)

sample graph:

FIG Effect:


2. Local variables:

Intelligent Recommendation

Define a style sheet (CSS selector)

Define a style sheet (CSS selector) HTML definition tag <p>...<p> format:p {attribute 1: attribute value 1; attribute 2: attribute value 2} pCan be called a selector, defining the content ...

MATLAB batch create (declare) workspace variables and assign values

MATLAB batch create (declare) workspace variables and assign values Configure MATLAB version requirements Effect picture Efficient variable declaration and assignment As a comparison In some applicati...

CSS variables: declare global variables, so write more quickly --root

  When writing style css public, we will declare many common color, size and so on. Now we can declare variables to achieve a CSS 1. declare variables CSS variable declaration is a former letter ...

CSS folding style (2)-define style sheet

The first style sheet can be (1) embedded style sheet (2) import style sheet, two ways to achieve, I put it in the form of code as follows: (1) Embedded style sheet demo.html (2) Lead-in style sheet d...

[CSS3]: Define CSS style and CSS priority mechanism

Rationalize the web page structure Before introducing how to define CSS styles, first understand why we need to define CSS styles. Remember that when you first started learning HTML web pages, when yo...

More Recommendation

Common properties and values ​​of CSS

CSS text CSS font CSS background...

CSS common properties and values

Font [html] view plain copy   <html>           <head>            &nb...

css common attributes and values

Font properties font font: font style [font bold] [/ Height] font-family font family Arial | Microsoft elegant black font-family:"Arial","Helvetica",sans-serif; font-size font size...

Custom attribute values ​​(variables) in CSS>

Articles directory Foreword CSS variable (custom attribute value) syntax grammar Summarize Foreword In front -end development, we often need to use a CSS style to decorate the page, but when developin...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top