CSS练习01

练习1

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
<div class="all">
<h1>做人做事的艺术</h1>
    <hr>
<p>
    <img src="img/1.jpg" alt="">
    做人做事是一门艺术,更是一门学问。很多人之所以一辈子都碌碌无为,那是因为他活了一辈子都没有弄明白该怎样去做人做事。</p>
<p>

每一个人生活在现实社会中,都渴望着成功,而且很多有志之士为了心中的梦想,付出了很多,然而得到的却很少,这个问题不能不引起人们的深思:你不能说他们不够努力,不够勤劳,可为什么偏偏落得个一事无成的结局呢?这值得我们每一个人去认真思考。从表面上看,做人做事似乎很简单,有谁不会呢?其实不然,比如说你当一名教师,你的主观愿望是当好教师,但事实上却不受学生欢迎;你去做生意,你的主观愿望是赚大钱,可偏偏就赔了本。抛开这些表层现象,去发掘问题的症结,你就会发现做人做事的确是一门很难掌握的学问。</p>
<p>

可以这么说,做人做事是一门涉及现实生活中各个方面的学问,单从任何一个方面入手研究,都不可能窥其全貌。要掌握这门学问,抓住其本质,就必须对现实生活加以提炼总结,得出一些具有普遍意义的规律来,人们才能有章可循,而不至于迷然无绪。</p>
<p>

每一个人生活在现实社会中,都渴望着成功,而且很多有志之士为了心中的梦想,付出了很多,然而得到的却很少,这个问题不能不引起人们的深思:你不能说他们不够努力,不够勤劳,可为什么偏偏落得个一事无成的结局呢?这值得我们每一个人去认真思考。从表面上看,做人做事似乎很简单,有谁不会呢?其实不然,比如说你当一名教师,你的主观愿望是当好教师,但事实上却不受学生欢迎;你去做生意,你的主观愿望是赚大钱,可偏偏就赔了本。抛开这些表层现象,去发掘问题的症结,你就会发现做人做事的确是一门很难掌握的学问。</p>
</div>
</body>
</html>

CSS样式

*{
    padding: 0;
    margin: 0;
}
h1 {
    text-align: center;
    height: 100px;
    line-height: 150px;
    color: #ff3502;
}
hr{
    color: #e3f1fa;
    margin: 5px 5px;
}
img{
    margin: 7px;
    padding: 5px;
    border:solid 2px #ff3300;
    float: left;
}
p{
    margin: 5px 8px 24px 8px;
}
body{
    background: url("img/bg111.gif") repeat;
}
.all{
    margin: 0 350px 120px 350px;
    text-indent: 24px;
    border: double 5px black;
    background-color: #ffcc99;
}

效果图
在这里插入图片描述

练习2

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/style_01.css">
</head>
<body>
<div id="header">
    <div class="logo fl">
        <img src="img/logo.gif" alt="">
    </div>
    <div class="nav fl">
        <a href="" class="one">首 页</a>
        <a href="">集团概况</a>
        <a href="">新闻中心</a>
        <a href="">产品服务</a>
        <a href="">企业文化</a>
        <a href="">综合业务</a>
        <a href="">品牌建设</a>
        <a href="">人力资源</a>
        <a href="">国际合作</a>
    </div>
</div>
<div id="banner">
    <img src="img/banner.gif" alt="">
</div>
<div id="content">
    <div class="content_left fl">
        <h3><span>图片</span>新闻</h3>
        <a href=""><img src="img/content01.jpg" alt=""></a>
    </div>
    <div class="content_main fl">
        <h3 class="title">集团新闻</h3>
        <ul>
            <li><a href="">郑州市委书记连维良一行视察郑州保利百合项目<span>[2012-11-17]</span></a></li>
            <li><a href="">中国保利集团副总经理国强一行视察浙江公司<span>[2012-11-17]</span></a></li>
            <li><a href="">保利集团总经理张振高一行视察辽宁公司<span>[2012-11-17]</span></a></li>
            <li><a href="">中国保利集团董事长陈洪生视察成都公司<span>[2012-11-17]</span></a></li>
            <li><a href="">国资委监事会主席时希平一行赴武汉公司视察<span>[2012-11-17]</span></a></li>
            <li><a href="">海心沙相约宋祖英 保利和乐中国完美落幕<span>[2012-11-17]</span></a></li>
            <li><a href="">保利地产荣获“2011中国房地产行业领导公司品牌”<span>[2012-11-17]</span></a></li>
            <li><a href="">国资委监事会主席时希平一行赴武汉公<span>[2012-11-17]</span></a></li>
        </ul>
    </div>
    <div class="content_right fr">
        <h3 class="title">公司简介</h3>
        <p><img src="img/company_02.jpg" class="fr"></img>保利房地产(集团)股份有限公司是中国保利集团控股的大型国有房地产上市公司,也是中国保利集团房地产业务的主要运作平台,国家一级房地产开发资质企业,国有房地产企业综合实力榜首,并连续五年蝉联央企房地产第一名。2006年7月,公司股票在上海.....</p>
    </div>
</div>
<div id="shows">
    <div class="show_left fl">
        <h3 class="title">项目展示</h3>
        <img src="img/1.jpg" alt="">
        <img src="img/2.jpg" alt="">
        <img src="img/3.jpg" alt="">
        <img src="img/4.gif" alt="">
    </div>
    <div class="show_right fr">
        <h3><span>站内</span>搜索</h3>
        <br>
        <h4 class="fl"><span> 关键字 </span></h4>
        <input type="text" class="fl"style="width: 130px">
        <a href=""><img src="img/top_search_btn.jpg" alt=""></a>
    </div>
</div>
<div id="footer">
    <p>版权信息:@正大软件学院.软件技术系所有</p>
    <p>2010-2020</p>
</div>
</body>
</html>

CSS样式

/*公共样式*/
*{
    padding:0;
    margin:0;
}
.fl{
    float:left;
}
.fr{
    float:right;
}
a{
    text-decoration:none;
}
li{
    list-style: none;
}
/*首页样式*/
#header,#banner,#content,#shows,#footer{
    width:960px;
    margin:auto;
    background: white !important;
}
body{
    background:url("../img/body.gif") repeat ;
    font-size: 12px;
}
/*头部区*/
#header{
    height: 54px;
}
.logo{
    height: 54px;
}
.nav{
    width: 730px;
    height:40px ;
    line-height: 40px;
    border-top: solid 6px black;
    margin-top: 9px;
    background: white;
}
.nav a{
    color:black ;
    font-size: 14px;
    padding: 0 13px;
    display: inline-block;
    float: left;
    height: 40px;
}
.nav a:hover,.one{
    color: white !important;
    background: #cc0202;
}
/*图片轮播区*/
#banner img{
    height:224px;
}
/*内容区*/
#content{
    height: 240px;
}
.content_left{
    width: 280px;
    background: white;
}
.content_main{
    width: 380px;
    padding: 0 5px;
    background: white;
}
.content_right{
    width: 280px;
    background: white;
}
h3{
    font-size: 14px;
    height: 30px;
    line-height: 30px;
    text-indent: 1.1em;
    margin-bottom: 4px;
}
.content_left span {
    color: #cc0235;
}
.content_left img{
    width:260px ;
    border: solid 1px #e6e5e5;
    border-radius: 5px;
    padding: 5px;
    margin: 5px;
    background: #f3f2f2;
}
.title{
    border-bottom:solid 2px red;
    background: url("../img/ico5.gif") no-repeat left center;
}
.content_main li{
    border-bottom: dashed 1px #c4c4c4;
    background: url("../img/ico1.gif") no-repeat left center;
    height: 25px;
    line-height: 25px;
    padding-left:10px;
}
.content_main span{
    float:right;
}
.content_main a{
    color: #505050;
}
.content_right img{
    width: 150px;
}
.content_right p{
    text-indent: 2em;
    line-height:18px ;
}
/*展示区*/
#shows{
    height: 210px;
    padding-bottom: 15px;
}
.show_left{
    width: 660px;
    padding-left: 5px;
}
.show_left img{
    width: 152px;
    margin-left:  10px;
}
.show_right {
    margin: 25px 10px;
    width: 200px;
    background: url("../img/searchbg.gif") no-repeat;
    height: 180px;
    padding-right: 25px;
}
.show_right span{
    color: red;
}
.show_right a{
    text-align: center;
}
.show_right img{
    margin: 10px 80px;
}
/*底部*/
#footer{
    padding-top: 20px;
    padding-bottom: 10px;
    background: #b2a695 !important;
    line-height: 30px;
    text-align: center;
    height: 50px;
}

效果图

在这里插入图片描述

练习3

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/style_03.css">
</head>
<body>
<div id="header">
    <div class="logo fl">
        <img src="img/logo.gif" alt="">
    </div>
    <div class="nav fl">
        <a href="">首 页</a>
        <a href="">集团概况</a>
        <a href=""class="one">新闻中心</a>
        <a href="">产品服务</a>
        <a href="">企业文化</a>
        <a href="">综合业务</a>
        <a href="">品牌建设</a>
        <a href="">人力资源</a>
        <a href="">国际合作</a>
    </div>
</div>
<div id="banner">
    <img src="img/zbanner.gif" alt="">
</div>
<div id="search">
    <div class="search_left fl">
        <ul>
            <li><img src="img/listmiddle.gif" alt="">您目前的位置:首页>>新闻中心</li>
        </ul>
    </div>
</div>
<div id="content">
    <h3>中国保利集团副总经理国强一行视察青岛公司</h3>
    <p class="date fr">Date:2011-12-12 View:188</p>
    <div class="zw fl">
        <p>2011年12月2日,中国保利集团副总经理国强一行莅临青岛,在保利地产青岛公司总经理邢巍等的陪同下,对保利·海上罗兰和保利·梨园里等项目进行了深入视察。</p>
        <p>在视察过程中,国强总对保利·海上罗兰等项目的整体规划、产品设计、工程施工和示范区展示给与高度评价,并对青岛公司在今年严峻视察形势下取得的良好业绩表示肯定;国强总强调,面对严峻的视察环境,公司在运作过程中更要检查以“品牌、品质、品味”三品委一天,以高品质、高性价比的产品和高水平的服务赢得市场,并秉承保利地产一贯的精品开发路线,不断图稿公司的核心竞争力。最近,国强总希望青岛公司在临近年底是,加快资金回笼,圆满完成公司各项任务指标。</p>
    </div>
    <img src="img/2011121352686433.jpg" alt="">
</div>
<div id="footer">
    <p>版权信息:@正大软件学院.软件技术系所有</p>
    <p>2010-2020</p>
</div>
</body>
</html>

css样式

/*公共样式*/
*{
    padding:0;
    margin:0;
}
.fl{
    float:left;
}
.fr{
    float:right;
}
a{
    text-decoration:none;
}
li{
    list-style: none;
}
/*首页样式*/
#header,#banner,#search,#content,#footer{
    width:960px;
    margin:auto !important;
    background: white;
}
body{
    background:url("../img/body.gif") repeat ;
    font-size: 12px;
}
/*头部区*/
#header{
    height: 54px;
}
.logo{
    width: 230px;
    height: 54px;
}
.nav{
    width: 730px;
    height:39px ;
    line-height: 39px;
    border-top: solid 6px black;
    margin-top: 9px;
    background: white;
    float: left;
}
.nav a{
    color:black ;
    font-size: 14px;
    padding: 0 13px;
    display: inline-block;
    float: left;
    height: 40px;
}
.nav a:hover,.one{
    color: white !important;
    background: #cc0202;
}
/*轮播区*/
#banner{
    height: 186px;
    width: 960px;
    margin: auto;
}
/*搜索区*/
#search{
    height: 37px;
    background: url("../img/navbg.gif");
}
.search_left{
    height: 37px;
    line-height: 37px;
}
.search_left li>img{
    height: 5px;
    width: 5px;
    border: solid 1px black;
}
/*内容区*/
#content{
    height: 600px;
}
#content h3{
    width: 920px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-bottom: dashed 1px #bbbbbb;
    margin: 0 20px;
}
.date{
    margin: 0 20px;
    height: 16px;

}
.zw p{
    margin: 10px 20px;
    text-indent: 2em;
    line-height: 20px;
}
#content img{
    margin: 20px 230px;
}
/*底部*/
#footer{
    padding-top: 20px;
    padding-bottom: 10px;
    background: #b2a695 !important;
    line-height: 30px;
    text-align: center;
    height: 50px;
}

效果图
在这里插入图片描述

练习4

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/style_02.css">
</head>
<body>
<div id="header">
    <div class="logo fl">
        <img src="img/logo.gif" alt="">
    </div>
    <div class="nav fl">
        <a href="">首 页</a>
        <a href="">集团概况</a>
        <a href=""class="one">新闻中心</a>
        <a href="">产品服务</a>
        <a href="">企业文化</a>
        <a href="">综合业务</a>
        <a href="">品牌建设</a>
        <a href="">人力资源</a>
        <a href="">国际合作</a>
    </div>
</div>
<div id="banner">
    <img src="img/zbanner.gif" alt="">
</div>
<div id="search">
    <div class="search_left fl">
        <ul>
            <li><img src="img/listmiddle.gif" alt="">您目前的位置:首页>>新闻中心</li>
        </ul>
    </div>
    <div class="search_right fr">
        <h3><span>站内搜索:</span><input type="text" style="width: 100px"> <a href="" class="fr"><img src="img/top_search_btn.jpg" alt=""></a></h3>
    </div>
</div>
<div id="content">
    <div class="content_left fl">
        <div class="lb"> <p>>新闻中心</p></div>

        <ul>
            <li><a href="">集团要闻</a></li>
            <li><a href="">经营动态</a></li>
            <li><a href="">企业专题</a></li>
            <li><a href="">项目新闻</a></li>
        </ul>

    </div>
    <div class="content_main fr">
        <h3>集团要闻<span class="yw">Group News</span></h3>
        <div content="xhx"></div>
        <ul>
            <li><a href="">中国保利集团副总经理国强一行视察青岛公司<span class="fr">[2011-12-12]</span></a></li>
            <li><a href="">郑州市委书记连维良一行视察郑州保利百合项目<span class="fr">[2011-11-17]</span></a></li>
            <li><a href="">保利集团总经理张振高一行视察辽宁公司<span class="fr">[2011-11-16]</span></a></li>
            <li><a href="">中国保利集团副总经理国强一行视察浙江公司<span class="fr">[2011-11-16]</span></a></li>
            <li><a href="">中国保利集团总经理张振高一行视察广东 华南公司<span class="fr">[2011-11-14]</span></a></li>
            <li><a href="">中国保利集团副总经理国强一行视察武汉公司<span class="fr">[2011-11-14]</span></a></li>
            <li><a href="">中国保利集团副总经理国强一行考察保利东江首府<span class="fr">[2011-10-31]</span></a></li>
            <li><a href="">中国保利集团董事长陈洪生视察成都公司<span class="fr">[2011-10-31]</span></a></li>
            <li><a href="">国资委监事会主席时希平一行赴武汉公司视察<span class="fr">[2011-10-31]</span></a></li>
            <li><a href="">海心沙相约宋祖英 保利和乐中国完美落幕<span class="fr">[2011-10-17]</span></a></li>
            <li><a href="">陈洪生董事长等领导一行抵武汉参加央企与地方政府合作发展洽谈会并观察项目<span class="fr">[2011-10-08]</span></a></li>
            <li><a href="">中国保利集团副总经理国强一行考察成都公司<span class="fr">[2011-09-30]</span></a></li>
            <li><a href="">保利地产荣获“2011中国房地产行业领导公司品牌”<span class="fr">[2011-09-14]</span></a></li>
            <li><a href="">保利地产总经理朱铭新一行视察武汉公司<span class="fr">[2011-09-08]</span></a></li>
            <li><a href="">保利地产董事长宋广局一行视察福建公司<span class="fr">[2011-09-02]</span></a></li>
            <li><a href="">广东省委委员会调研团考察福建公司<span class="fr">[2011-08-20]</span></a></li>
            <li><a href="">保利地产2011年新员工入职培训圆满结束<span class="fr">[2011-08-18]</span></a></li>
            <li><a href="">合肥保利香槟国际开工盛典隆重举行<span class="fr">[2011-08-15]</span></a></li>
            <li><a href="">国资委监事会主席时希平一行赴保利地产北京公司调研<span class="fr">[2011-08-10]</span></a></li>
            <li><a href="">广东省省长黄华华视察调研保利利银滩<span class="fr">[2011-08-09]</span></a></li>
            共<span style="color: red">10</span>页<span style="color: red">196</span>条记录
            <a href="">上一页</a>
            <a href="">1</a>
            <a href="">2</a>
            <a href="">3</a>
            <a href="">4</a>
            <a href="">5</a>
            <a href="">下一页</a>
        </ul>
    </div>
</div>
<div id="footer">
    <p>版权信息:@正大软件学院.软件技术系所有</p>
    <p>2010-2020</p>
</div>
</body>
</html>

CSS样式

/*公共样式*/
*{
    padding:0;
    margin:0;
}
.fl{
    float:left;
}
.fr{
    float:right;
}
a{
    text-decoration:none;
}
li{
    list-style: none;
}
/*首页样式*/
#header,#banner,#search,#content,#footer{
    width:960px;
    margin:auto !important;
    background: white;
}
body{
    background:url("../img/body.gif") repeat ;
    font-size: 12px;
}
/*头部区*/
#header{
    height: 54px;
}
.logo{
    width: 230px;
    height: 54px;
}
.nav{
    width: 730px;
    height:39px ;
    line-height: 39px;
    border-top: solid 6px black;
    margin-top: 9px;
    background: white;
    float: left;
}
.nav a{
    color:black ;
    font-size: 14px;
    padding: 0 13px;
    display: inline-block;
    float: left;
    height: 40px;
}
.nav a:hover,.one{
    color: white !important;
    background: #cc0202;
}
/*轮播区*/
#banner{
    height: 186px;
    width: 960px;
    margin: auto;
}
/*搜索区*/
#search{
    height: 37px;
    background: url("../img/navbg.gif");
}
.search_left{
    height: 37px;
    line-height: 37px;
}
.search_left li>img{
    height: 5px;
    width: 5px;
    border: solid 1px black;
}
.search_right{
    display: inline-block;
    height: 37px;
    line-height: 37px;
    width: 300px;
}
.search_right span{
    color: #da6b69;
    margin-right: 5px;
}
.search_right img{
    float: right;
    width: 90px;
    margin:3px 30px 3px 5px;
}
/*内容区*/
#content{
    height: 550px;
}
.content_left{
    width: 208px;
    height: 220px;
    margin: 20px 40px;
    background: url("../img/imgbg.gif") no-repeat left top;
}
.lb{
    color: white;
    font-size: 14px;
    background: url("../img/listhead.gif") no-repeat;
    height: 35px;
    line-height: 35px;
    margin-bottom: 10px;
}
.content_left li{
    width: 150px;
    list-style-type: circle;
    border-bottom: dashed 1px #b2a695;
    margin:0 20px;
    height: 30px;
    line-height: 30px;

}
.content_left a{
    color: black;
}
.content_main{
   width: 570px;
    padding-right: 30px;
}
.content_main h3{
    border-bottom: 2px solid #dbdbdb;
    padding-top: 20px ;
    padding-bottom: 5px;
}
.content_main li{
    list-style-type: square;
    height: 22px;
    line-height: 22px;
    border-bottom: dashed 1px #b2a695;
}
.content_main a{
    color: black;
}
.yw{
    font-size: 12px;
    color: #dfdfdf;
    margin-left: 5px;
}
/*底部*/
#footer{
    padding-top: 20px;
    padding-bottom: 10px;
    background: #b2a695 !important;
    line-height: 30px;
    text-align: center;
    height: 50px;
}

效果图

在这里插入图片描述

  • 3
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值