div+css笔记

1、行内样式

  <div style="height:100px; width:100px; border:1px solid red;"></div> 

2、内嵌式

<head>

  <style type="text/css">

    div{

    width:100px;

    height:100px;

    border:1px;}    -----------标签选择器           

    .c1{

    width:10px;

    height:10px;} ------------类选择器 ( <div class="c1"></div>),可以多个标签共用一个class,  class=c1 c2; c2会覆盖c1相同的样式

    #d1{

      width:100px;

    height:100px;}------------id选择器(<div id="d1"></div>)

  </style>

</head>

  *优先级 id>class>标签   行内优先级最高

 

3、链接式

 <link rel="stylesheet" type="text/css" href="css/1.css"/>

 

4、导入样式(淘汰)

 <style>

  @import url(css/1.css)

 </style>

 

 *css注释方法  /*    */

 

5、字体样式

font-size 字体大小 font-family 字体样式  font-weight 字体加粗  color 字体颜色

Text-decoration:underline    /*下划线*/

Text-decoration:overline     /*顶划线*/

Text-decoration:line-through; /*删除线*/

 

    *css具有继承性,但不是所有的样式都继承

 

Text-decoration:underline    /*下划线*/

Text-decoration:overline     /*顶划线*/

Text-decoration:line-through; /*删除线*/

Letter-spacing (默认为normal)  字母间距

 

对齐方式

text-align:left; 居左     right居右  center居中

 *垂直居中 line-height等于height

 

  

posted @ 2015-09-24 17:57  .NET_ClassRoom  阅读(354)  评论(0编辑  收藏  举报