CSS基础-37HTML与CSS简单页面效果实例

本文介绍了一个使用HTML和CSS实现的简单页面布局案例。页面包括头部导航、主体内容及底部区域,通过灵活运用CSS样式实现了良好的视觉效果。文章重点介绍了如何通过CSS进行布局调整,如元素定位、浮动及响应式设计等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!DOCTYPE html>
<!--HTML与CSS简单页面效果实例-->
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link href="css16.css" type="text/css" rel="stylesheet">
</head>
<body>
    <div class="rongqi">
        <!--主体-->
        <div class="shangbu">
            <div class="head">
                <div class="head_rongqi">
                    <!--导航的题目-->
                    <div class="head_timu">导航题目</div>
                    <!--导航-->
                    <div class="head_daohang">
                        <ul>
                            <li><a href="#">首页</a></li>
                            <li><a href="#">职业课程</a></li>
                            <li><a href="#">技术问答</a></li>
                            <li><a href="#">vip会员</a></li>
                        </ul>
                    </div>
                    <div class="head_img">
                        <img src="images/item1.jpg">
                    </div>
                    <div class="head_form">
                        <form>
                            <input type="text">
                        </form>
                    </div>
                </div>
            </div>
            <div class="body">
                <div class="body_tiyle">
                    <h3>极客学院</h3>
                    <p>APICloud是中国领先的“云端一体”的移动应用云服务提供商。
                        [1] APICloud为开发者从“云”和“端”两个方向提供API,
                        简化移动应用开发技术,让移动应用的开发周期从一个月缩短到7天。
                        基于APICloud提供的“云API”和“端API”,
                    </p>
                    <hr/>
                    <hr/>
                </div>
            </div>
        </div>
        <!--脚部-->
        <div class="foot">
            @极客学院
        </div>
    </div>

</body>

</html>

css:

*{
    margin: 0px;
    padding: 0px;
}
body{
    background-color: #cccccc;
}
.shangbu{
    width: 80%;
    height: 1000px ;
    background-color: #b3d4fc;
    /*上下边距是0 左右自适应 就是居中*/
    margin: 0px auto;

}
.head{
    width: 100%;
    height: 100px;
    margin: 0px auto;
    background-color: aquamarine;
}
.head_timu{
    float: left;
    font-size: 30px;
    padding: 6px;
    color: #222222;
    font-family: cursive;
    display: inline;
}
.head_rongqi{
    padding-top: 30px;
    padding-bottom: 30px;
    width: 100%;
    height: 30px;
    position: relative;
}

li{
    padding-left: 10px;
    display: inline;
}
ul{
    margin-left: 40px;
    float: left;
    /*去掉列表前面的点*/
    list-style-type: none;
    padding-top: 6px;
    padding-bottom: 6px;
}
a:link,a:visited{
    /*字体加粗*/
    font-weight: bold;
    color: #222222;
    text-align: center;
    /*去掉下划线*/
    text-decoration: none;
    padding: 6px;

}
/*鼠标放上去效果,点击时的效果*/
a:hover,a:active{
    color: #ff0000;

}
.head_img img{
    border-radius: 30px;
    display: inline;
    width: 26px;
    height: 26px;
    box-shadow: 0px 1px 1px rgba(0,0,0,0.2);
    float: right;

}
/*设置表单*/
.head_form form{
    float: right;
    width: 100px;
    height: 26px;
    position: relative;
    margin-right: 100px;
}
/*设置表单中的东西*/
.head_form form input{
    height: 26px;
    border-radius: 30px;
}
.foot{
    padding-top: 10px;
    text-align: center;
    color: #999999;
    font-size: 20px;
}
.body_tiyle h3{
    color: cornflowerblue;
    font-size: 30px;
    font-family: monospace, monospace;
}
.body{
    padding: 30px;
    width: auto;
    height: auto;

}
.body_tiyle p{
    margin-top: 20px;
    margin-bottom: 20px;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值