zoukankan      html  css  js  c++  java
  • 格式布局(课堂代码)

     1 <style>
     2 #a
     3 {
     4     border:3px solid blue;
     5     height:100px;
     6     width:100px;
     7     background-color:#C90;
     8     bottom:0px;
     9     right:0px;
    10     position:fixed;}
    11 .b
    12 {
    13     border:3px solid blue;
    14     height:100px;
    15     width:100px;
    16     background-color:#C90;
    17     bottom:100px;
    18     right:100px;
    19     position:absolute;}
    20 .c
    21 {
    22     border:2px solid red;
    23     height:200px;
    24     width:400px;}
    25 .d
    26 {
    27     border:2px solid red;
    28     height:200px;
    29     width:400px;
    30     position:absolute;}
    31 </style>
    32 </head>
    33 
    34 <body>
    35 <div id="a">a</div>
    36 <div class="c">c<div class="b">b</div></div>
    37 <div class="d">d<div class="b">bb</div></div>
    38 </body>

    效果图为:

     1 <style>
     2 #a
     3 {
     4     background-color:#F03;
     5     border:2px solid blue;
     6     height:100px;
     7     width:100px;
     8     top:30px;
     9     left:30px;
    10     position:fixed;}
    11     #aa
    12 {
    13     background-color:#F03;
    14     border:2px solid blue;
    15     height:100px;
    16     width:100px;
    17     top:80px;
    18     left:80px;
    19     position:relative;}
    20 </style>
    21 </head>
    22 
    23 <body>
    24 <div id="a">a</div>
    25 <div id="aa">aa</div>
    26 </body>

    效果图为:

     1 <style>
     2 #a
     3 {
     4     border:2px solid green;
     5     height:300px;
     6     width:100px;
     7     float:left;}
     8     #b
     9 {
    10     border:2px solid green;
    11     height:300px;
    12     width:100px;
    13     float:right;}
    14 </style>
    15 </head>
    16 
    17 <body>
    18 <div id="a">a</div>
    19 <div id="b">b</div>
    20 </body>

    效果图为:

  • 相关阅读:
    函数节流和防抖
    前端优化
    webpack模块
    link和@import的区别
    BFC--CSS
    javaoop_破解jdbc
    javaoop反射
    java-oop集合与泛型
    java中几个小遗漏
    java异常处理和日志管理
  • 原文地址:https://www.cnblogs.com/hanazawalove/p/5314401.html
Copyright © 2011-2022 走看看