CSS 08-01 爱宠知识 案例思路笔记

1.首先确定结构
*清除内外边距

1.整个为一个大盒子,测量高宽.W H
2.然后测量边框,border:1px solid red;
3.然后给bgi
4.然后给一个margin:20px auto 0;
5.最后分析给一个padding:10px

这里有宽所以会撑大!要减去

.box {
            width: 240px;
            height: 307px;
            margin: 20px auto 0;
            border: solid 1px #a4cf61;
            background-image: url(images/bg.gif);
            padding: 10px;
        }

2.header
1.一个h2标题
文字颜色color
字体大小
字体样式,黑体
然后左边的颜色竖线可以给左边框一个4px solid red;
最后这个左边框和文字应该有个padding-left值5px

这里没有宽度 ,所以不会撑大!

.news h2 {
            border-left: 3px solid #c9e143;
            padding-left: 5px;
            color: white;
            font-size: 20px;
            font-weight: 600;

        }

3.body
构建结构ul li a
ul
1.margin-top:5px;上面给一个5距离
2.左右给padding:0 5px;
3.测量h 279px
4.给个bgc

li
1.line-height:30px;垂直居中
2.给个border-bottom:1px dashe ccc;
3.插入小图标,背景照片 no-repeat left center

a
color
font-size
text-decoration
margin-left:16px 这里给a链接本身一个左外边距,让图片看得见

hover:
text-decoration:underline;
color:red

.news ul {
            margin-top: 5px;
            padding: 0 10px;
            height: 279px;
            background-color: #fff;
        }

        .news li {
            list-style: none;
            line-height: 30px;
            border-bottom: 1px dashed #ccc;
            background: url(images/tb.gif) no-repeat left center;
            /* padding-left: 15px; */

        }

        .news li a {
            color: #06c;
            font-size: 12px;
            text-decoration: none;
            margin-left: 16px;
        }

        .news li a:hover {
            text-decoration: underline;
            color: red;
        }
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不停喝水

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值