zoukankan      html  css  js  c++  java
  • CSS(refer to my training)

    一.What is CSS
    1.CSS stands for Cascading Style Sheets
    2.Styles define how to display HTML elements
    3.Style Sheets Can Save a Lot of Work
    二. Cascading Order
    What style will be used when there is more than one style specified for an HTML element?
    1. Browser default
    2. External style sheet
    3. Internal style sheet (inside the <head> tag)
    4. Inline style (inside an HTML element) 
     Number four has the higheset priority
    三.CSS Syntax
    The CSS syntax is made up of three parts: a selector, a property and a value:
    selector {property: value}
    body {color: black}
    p {font-family: "sans serif"}
    p {
      text-align: center;
      color: black;
       font-family: arial
    }


    .center {text-align: center}
    <h1 class="center"> This heading will be center-aligned </h1>
    <p class="center"> This paragraph will also be center-aligned. </p>

    You can also define styles for HTML elements with the id selector. The id selector is defined as a #.The style rule below will match the element that has an id attribute with a value of "green":
     #green {color: green}
    The style rule below will match the p element that has an id with a value of "para1":
     p#para1 { text-align: center; color: red }

  • 相关阅读:
    Tomcat笔记
    HAProxy简介
    Ansible简介与实验
    DHCP&PXE&Cobbler简单实现
    Keepalived实现LVS-DR集群高可用
    Web of Science爬虫(WOS、SCI):风车WOS下载器
    梦境时分,记录梦境
    基层码农谈领导力
    企业部署 Kubernetes 的终极目标是什么
    Scrum 敏捷实践中的三大角色
  • 原文地址:https://www.cnblogs.com/engine1984/p/1109277.html
Copyright © 2011-2022 走看看