2016 - 1 - 25 CSS初步

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2016 - 1 - 25 CSS初步相关的知识,希望对你有一定的参考价值。

 

1.The customising link

   We can change the link‘s style when we move our pointer on the link like that:

    1.1 The " text-decoration:none "means remove the underline !

a:hover{
    color: black;
    background-color: red;
    text-decoration: none;
}

   1.2 Why should we customise links?

     To emphasise to the user where the links are.

 

   1.3 What is the purpose of a CSS selector?

     It connects a set of CSS properties to things in the html document.

   

   1.4 a:hover is a CSS selector to select links that the user is hovering over and we can set a different set of style properties for the link when the user moves the mouse over it.

     
 

   

2.Layout Control

   U can set  classes on anything, and actually if u define the class u can use the class to a different tags .

   And we can set any bit text we want. Especially when we use the span class which allow us to cut in .

   like that :   

.indent {
    margin-left: 50px;
}
.gap_bellow{
    margin-bottom: 100px;
}
  <h1 class = "gap_bellow"><span class = "indent">This is my first page!</span>This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!This is my first page!</h1>

 

 

 

    

3.CSS Media Queries

  Responsiveness can be implemented in CSS with something called CSS Media Queries.

  1. The code means let the body‘s background color be green when brower‘s window has minimum width 1000px  

      And we call the " min-width : 1000px " test !

@media(min-width:1000px){
    body{
        background: green;
    }
}

 

  

以上是关于2016 - 1 - 25 CSS初步的主要内容,如果未能解决你的问题,请参考以下文章

如何创建工具提示?

为啥这个 CSS 片段可以画一个三角形? [复制]

超级有用的9个PHP代码片段

CSS代码片段

CSS代码片段

VSCode自定义代码片段——CSS选择器