css入门代码

外部样式表

<html>
<head>
<title>css入门</title>
<link rel="stylesheet" type="text/css" href="basic.css"/>
</head>
<body>
<div id="logo">flash</div>
<div id="banner">宣传画</div>
<div id="nav">导航</div>
<div id="hot">
<h1>热点新闻</h1>
</div>
<div id="content">主要内容</div>
<div id="intro">介绍</div>
<div id="footer">版权</div>
</body>
</html>

css代码

* {
    margin:0;
    padding:0;
}
body {
    width:760px;
    margin:0 auto;
    font-size:12px;
}

ul {
    list-style-type:none;
}

#logo {
    width:760px;
    height:190px;
    background-color:red;
}

#banner {
    width:760px;
    height:40px;
    margin-bottom:10px;
    background-color:blue;
}
#nav {
    width:760px;
    height:60px;
    margin-bottom:10px;
    background:yellow;
}
#hot {
    width:250px;
    height:226px;
    margin-bottom:10px;
    background:yellow;
    float:right;
}
#intro  {
    width:250px;
    height:100px;
    margin-bottom:10px;
    background:pink;
    float:right;
}
#content {
    width:500px;
    height:336px;
    margin-bottom:10px;
    background:purple;
    float:left;
}
#footer {
    clear:both;
    width:760px;
    height:120px;
    background:rgb(255,255,0);
}

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值