Blogger Information
Blog 28
fans 2
comment 0
visits 23313
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
7.4盒模型的案例 及常见选择器
背着吉他的女侠
Original
601 people have browsed it

作业:
1. 写一个盒子, 要求用到margin,padding,border, 并用到它们的完整语法, 简写语法

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>写一个盒子, 要求用到margin,padding,border, 并用到它们的完整语法, 简写语法</title>
    <style>

#box1{

    width: 200px;
    height: 250px;
    background: palevioletred;
    border: 5px solid green;
    padding: 20px 20px 20px 20px;     /*上右下左为20px*/
    padding:20px 20px 20px;           /*上为20px,左右为20px,下为20px*/
    padding:20px 20px;               /*上下左右为20px*/
    padding:20px;                   /*内边距为20px     */
    margin: 20px 20px 20px 20px;     /*上右下左为20px*/
    margin:20px 20px 20px;           /*上为20px,左右为20px,下为20px*/
    margin:20px 20px;               /*上下左右为20px*/
    margin:20px;                   /*内边距为20px     */
}



    </style>
</head>
<body>
<div id="box1" >阳光下微笑,风雨中奔跑,做快乐的自己,奈何别人的眼光!</div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

2. 模仿课堂案例, 熟悉基本选择器的用法: 属性, 兄弟, 类型, 伪类等,自己举例完成,例如商品列表等来完成它, 重点放在nth-child, nth-of-type的理解上, 一定要多练多想为什么,并能分析执行的结果。

Correction status:qualified

Teacher's comments:好, 坚持
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post