美文网首页
CSS字体属性背景属性块&行标签盒子模型盒子模型-边距属性(了解

CSS字体属性背景属性块&行标签盒子模型盒子模型-边距属性(了解

作者: 逻辑演绎法 | 来源:发表于2017-05-14 14:45 被阅读0次

字体属性
<pre>
<!DOCTYPE html>
<html>
<head>
<title>09-CSS选择器5.html</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
```
<style type="text/css">
    /* p{
        font-family: 黑体;
        font-size: 25px;
        font-style:oblique;
         font-weight:900;
         font-variant:small-caps;
    } */
    p{
        font:oblique small-caps 900 25px 黑体;
    }
</style>
  </head>
  
  <body>
    <p class="two" >
    hello itcast! itheima!
    床前明月光,疑是地上霜</a>
  </body>
</html>
</pre>
背景属性
<pre>
<!DOCTYPE html>
<html>
  <head>
    <title>11-背景属性.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <style type="text/css">
        /* 
            background : background-color || background-image || background-repeat || background-attachment || background-position 
body{
            background-image: url("mn.jpg");
            background-repeat: no-repeat;
            background-attachment: fixed;
        }
     */
        body{
            background: url("mn.jpg") no-repeat fixed center;
        }
    </style>
  </head>
  <body>
    <p>
        itheima<br>
        itheima<br>
        itheima<br>
        itheima<br>
        itheima<br>
    </p>
        <p>
        itheima<br>
        itheima<br>
        itheima<br>
        itheima<br>
        itheima<br>
    </p>
  </body>
</html>
</pre>
块&行标签
<pre>
<!DOCTYPE html>
<html>
  <head>
    <title>12-块&行标签.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

</head>

<body>
itheima<div>itheima</div>itheima

itheima<span>itheima</span>itheima
</body>

</html>
</pre>
盒子模型
<pre>

<!DOCTYPE html>
<html>
  <head>
    <title>12-块&行标签.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <style type="text/css">
    /*
    盒子模型的属性
        一. 边框系类属性
        二. 尺寸属性
        三. 边距
                *内边距
                *外边距
    
    
        border-color:边框颜色
        border-width:边框宽度
        border-style:边框样式
        
            border-color: red;
            border-width: 1px;
            border-style: solid;
            
            margin-left:100px;左外边距
            margin-top:100px;
            
            padding-left:100px; 左内边距
            padding-top:100px; 上内边距
            
            注意:内边距会延长所在盒子的长或宽
    */
    div{
        border: 1px solid red;
    }
    
    #one{
        height: 300px;
        width: 300px;
    }
    #two{
        height: 100px;
        width: 100px;
        margin-left:100px;
        margin-top:100px;
    }
    </style>
    
  </head>
  
  <body>
    <div id="one" >
        <div id="two"></div>
    </div>
  </body>
</html>

</pre>
盒子模型边距属性
<pre>

<!DOCTYPE html>
<html>
  <head>
    <title>14-盒子模型-边距属性.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <style type="text/css">
    /*
    padding : 1个值 上下左右
              2个值    1.上下 2.左右
              3个值    1.上 2.左右 3.下
              4个值     1.上 2.右 3.下 4.左
    */
    div{
        border: 1px solid red;
        height: 300px;
        width: 300px;
    }
    
    #one{
        padding: 10px 30px 50px 80px;
    }
</style>
    
  </head>
  
  <body>
<div id="one" >
    <div id="two"></div>
</div>
 </body>
</html>

</pre>

相关文章

  • CSS字体属性背景属性块&行标签盒子模型盒子模型-边距属性(了解

    字体属性 09-CSS选择器5.html itheima itheima it...

  • CSS属性

    link标签的rel属性 rel属性值: CSS的单位 字体的属性 文本属性 背景属性 列表属性 (重要)盒子模型...

  • CSS之盒子模型

    CSS 盒子模型描述 盒子模型的属性有边框、内边距、外边距,如图所示: 边框:使用border属性来定义,元素的边...

  • # 边框属性

    # 边框属性 # 内边距 # 外边距 # CSS盒子模型 # box-sizing #清空默认边距 #行高(lin...

  • CSS属性总结

    字体属性 font 文本属性 text 背景属性 background 列表属性 list-style 盒子模型 ...

  • CSS

    1标准的CSS的盒子模型?与低版本IE的盒子模型有什么不同的? CSS盒子模型:由四个属性组成的外边距(margi...

  • CSS 基础知识点

    介绍一下标准的CSS的盒子模型?与低版本IE的盒子模型有什么不同的? CSS盒子模型:由四个属性组成的外边距(ma...

  • 可继承的CSS样式属性

    不可继承:边框,盒子模型,背景属性 可继承:字体,文本样式属性 不可继承的:display、margin、bord...

  • React Native之FlexBox布局

    CSS的布局,基于盒子模型,依赖 display属性 , position属性, float属性。但对于那些特殊布...

  • 盒子模型、BFC、清除浮动

    盒子模型、BFC、浮动 盒子模型box model。盒子属性标准盒模型、IE盒模型的区别CSS如何设置这两种模型J...

网友评论

      本文标题:CSS字体属性背景属性块&行标签盒子模型盒子模型-边距属性(了解

      本文链接:https://www.haomeiwen.com/subject/jisqxxtx.html