首页 > 其他分享 >HTML+CSS 公司官网首页 浮动布局!!

HTML+CSS 公司官网首页 浮动布局!!

时间:2024-08-26 13:21:35浏览次数:13  
标签:box 官网 width HTML yw news new main CSS

网页展示:

 HTML部分:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div class="main">
        <div class="header">
            <div class="header_box">
                <div class="left">
                    <img src="picture/logo.png" alt="">
                </div>
                <div class="right">
                    <div class="top">
                        <span>客服电话:0000-000-000</span>
                        <span>China(中文) |  English(英文)</span>
                    </div>
                    <div class="middle">
                        <input type="text">
                    </div>
                    <div class="bot">           
                        <a href="" class="on">首页</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>
        </div>
        <div class="banner">
            <img src="picture/banner.jpg" alt="">
        </div>
        <div class="news">
            <div class="new_box">
                <div class="title">
                    <p>新闻中心</p>
                    <p>媒体举报</p>
                    <p>联系我们</p>
                </div>
                <div class="new_list">
                    <div class="news_item">
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                        <p>
                            <span class="tit">从中国企业企业文化的现实出发...</span>
                            <span class="time">[0000-00-00]</span>
                        </p>
                    </div>
                    <div class="news_item">
                        <div class="new_middle">
                            <div class="tips">
                                111
                            </div>
                            <div class="news_img">
                                <img src="picture/goods1.jpg" alt="">
                            </div>
                            <div class="msg">
                                <p class="tit">
                                    媒体报道
                                </p>
                                <p class="con">报道新闻的内容内容内容内容
                                    内容...[详情]</p>
                            </div>
                        </div>
                        <div class="new_middle">
                            <div class="tips">
                                111
                            </div>
                            
                            <div class="news_img">
                                <img src="picture/goods1.jpg" alt="">
                            </div>
                            <div class="msg">
                                <p class="tit">
                                    媒体报道
                                </p>
                                <p class="con">报道新闻的内容内容内容内容
                                    内容...[详情]</p>
                            </div>
                        </div>
                        <div class="new_middle">
                            <div class="tips">
                                111
                            </div>
                            <div class="news_img">
                                <img src="picture/goods1.jpg" alt="">
                            </div>
                            <div class="msg">
                                <p class="tit">
                                    媒体报道
                                </p>
                                <p class="con">报道新闻的内容内容内容内容
                                    内容...[详情]</p>
                            </div>
                        </div>
                    </div>
                    <div class="news_item">
                        <div class="top_img">
                            <img src="picture/good2.jpg" alt="">
                        </div>
                        <p>服务热线:0000-000-000</p>
                        <p>企业电话:000-00000000</p>
                        <p>企业地址:xxxxxxxxxxxxxxxx
                            xxxxxx</p>
                    </div>
                </div>
            </div>

        </div>
        <div class="yw">
            <div class="yw_box">
                <div class="title">
                    主营业务
                </div>
                <div class="list">
                    <div class="item">
                        <div class="top_img">
                            <img src="picture/goods3.jpg" alt="">
                        </div>
                        <div class="txt">
                            <span>业务名称</span>
                            <img src="picture/arrows.jpg" alt="">
                        </div>
                    </div>
                    <div class="item">
                        <div class="top_img">
                            <img src="picture/goods3.jpg" alt="">
                        </div>
                        <div class="txt">
                            <span>业务名称</span>
                            <img src="picture/arrows.jpg" alt="">
                        </div>
                    </div>
                    <div class="item">
                        <div class="top_img">
                            <img src="picture/goods3.jpg" alt="">
                        </div>
                        <div class="txt">
                            <span>业务名称</span>
                            <img src="picture/arrows.jpg" alt="">
                        </div>
                    </div>
                    <div class="item">
                        <div class="top_img">
                            <img src="picture/goods3.jpg" alt="">
                        </div>
                        <div class="txt">
                            <span>业务名称</span>
                            <img src="picture/arrows.jpg" alt="">
                        </div>
                    </div>
                </div>
                <div class="hf">
                    <div class="hf_item">
                        <div class="img">
                            <img src="picture/icon11.jpg" alt="">
                        </div>
                        <div class="txt">
                            <p class="txt1">发展历程</p>
                            <p class="txt2">蓬勃发展,兴旺昌盛</p>
                        </div>
                    </div>
                    <div class="hf_item">
                        <div class="img">
                            <img src="picture/icon22.jpg" alt="">
                        </div>
                        <div class="txt">
                            <p class="txt1">资质荣誉</p>
                            <p class="txt2">重视合作,确保质量,严守承诺</p>
                        </div>
                    </div>
                    <div class="hf_item">
                        <div class="img">
                            <img src="picture/icon33.jpg" alt="">
                        </div>
                        <div class="txt">
                            <p class="txt1">媒体报道</p>
                            <p class="txt2">振兴民族产业,走在国际前沿</p>
                        </div>
                    </div>
                    <div class="hf_item">
                        <div class="img">
                            <img src="picture/icon44.jpg" alt="">
                        </div>
                        <div class="txt">
                            <p class="txt1">诚聘精英</p>
                            <p class="txt2">有品质有市场,有改善有进步</p>
                        </div>
                    </div>
                </div>
            </div>  
        </div>
        <div class="share">
            <div class="share_box">
                <div class="left">
                    分享:
                    <img src="picture/icon1.jpg" alt="">
                    <img src="picture/icon2.jpg" alt="">
                    <img src="picture/icon3.jpg" alt="">
                    <img src="picture/icon4.jpg" alt="">
                    <img src="picture/icon5.jpg" alt="">
                    <img src="picture/icon6.jpg" alt="">
                </div>
                <div class="right">
                    <input type="text">
                    <span></span>
                </div>
            </div>
        </div>
        <div class="footer">
            <div class="footer_box">
                <div class="item">
                    <p>企业简介</p>
                    <p>企业简介</p>
                    <p>企业简介</p>
                    <p>企业简介</p>
                    <p>企业简介</p>
                    <p>企业简介</p>
                </div>
                <div class="item">
                    <p>下属企业</p>
                    <p>下属企业</p>
                    <p>下属企业</p>
                    <p>下属企业</p>
                    <p>下属企业</p>
                    <p>下属企业</p>
                </div>
                <div class="item">
                    <p>新闻中心</p>
                    <p>新闻中心</p>
                    <p>新闻中心</p>
                    <p>新闻中心</p>
                    <p>新闻中心</p>
                    <p>新闻中心</p>
                </div>
                <div class="item">
                    <p>主营业务</p>
                    <p>主营业务</p>
                    <p>主营业务</p>
                    <p>主营业务</p>
                    <p>主营业务</p>
                    <p>主营业务</p>
                </div>
                <div class="item">
                    <p>企业文化</p>
                    <p>企业文化</p>
                    <p>企业文化</p>
          
                </div>
                <div class="item">
                    <p>企业招聘</p>
                    <p>企业招聘</p>
                    <p>企业招聘</p>
                </div>
                <div class="item">
                    <p>联系我们</p>
                    <p>联系我们</p>
                </div>
            </div>
        </div>
        <div class="footer_bottom">
             <div class="footer_bottom_box">
                 <p>版权所有:xxxx企业名称    备案号:?icp备00000号</p>
                 <p>服务热线:0000-000-000</p>
             </div>
        </div>
    </div>
</body>
</html>

CSS部分:


*{
    padding: 0;
    margin: 0;
}
div{
    box-sizing: border-box;
}
img{
    width: 100%;
    height: 100%;
    display: block;
}
a{
    text-decoration: none;
}
.main{
    width: 100%;
    height: 100%;
    background-color: #fff;
}
.main .header{
    width: 100%;
    height: 120px;
}
.main .header .header_box{
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 1320px;
    height: 100%;
    margin: auto;
}
.main .header .header_box .left{
    width: 273px;
    height: 41px;
}
.main .header .header_box .right{
    position: relative;
    height: 100%;
    width: 840px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
}
.main .header .header_box .top{
    text-align: right;
    color: #808080;
    font-size: 16px;
}
.main .header .header_box .middle{
    position: relative;
    width: 220px;
    height: 30px;
    border: 1px solid #0058a6;
    margin-left: 598px;
}
.main .header .header_box .middle::before{
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: block;
    background: url("../image/search.jpg") no-repeat;
    background-size: 100% 100%;
    width: 28px;
    height: 23px;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
}
.main .header .header_box .middle input{
    width: 100%;
    height: 100%;
    border: none;
    background: none;
}
.main .header .header_box .bot{
    display: flex;
 
    justify-content: flex-end;
}
.main .header .header_box .bot a{
    font-size: 18px;
    color: #4c4c4c;
    margin-left: 40px;
    white-space: nowrap;
    padding-bottom: 8px;
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
}
.main .header .header_box .bot a:hover{
    color: #0058a6;
    height: 100%;
    font-weight: bold;
    border-bottom:2px solid #0058a6;
}
.main .header .header_box .bot a.on{
    height: 100%;
    border-bottom: 2px solid #0058a6;
}
.main .banner{
    width: 100%;
}
.main .banner img{
    width: 100%;
    height: auto;
}
.main .news{
    width: 100%;
}
.main .news .new_box{
    width: 1320px;
    margin: 45px auto 0;
}
.main .news .new_box .title{
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #0058a6;
}
.main .news .new_box .title p{
    font-size: 22px;
    color: #000;
    font-weight: bold;
    line-height: 40px;

}
.main .news .new_box .title p:nth-of-type(1),.main .news .new_box .new_list .news_item:nth-of-type(1){
    width: 440px;
}
.main .news .new_box .title p:nth-of-type(2),.main .news .new_box .new_list .news_item:nth-of-type(2){
    width: 480px;
}
.main .news .new_box .title p:nth-of-type(3),.main .news .new_box .new_list .news_item:nth-of-type(3){
    width: 340px;
}
.main .news .new_box .new_list{
    display: flex;
    justify-content: space-between;
}
.main .news .new_box .new_list .news_item:nth-of-type(1) p:hover .tit{
    color: #0058a6;
    font-weight: bold;
}
.main .news .new_box .new_list .news_item:nth-of-type(1) p{
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 32px;
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
}
.main .news .new_box .new_list .news_item:nth-of-type(1) p .tit{
    position: relative;
    padding-left: 20px;
    color: #808080;
    font-size: 14px;
}
.main .news .new_box .new_list .news_item:nth-of-type(1) p .tit::before{
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 4px;
    height: 4px;
    background-color: #0058a6;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
}
.main .news .new_box .new_list .news_item:nth-of-type(1) p .time{
    color: #808080;
    font-size: 14px;
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 9px;
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle:hover .tit{
    color: #0058a6;
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle:hover img{
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle .tips{
    width: 130px;
    height: 73px;
    text-align: center;
    line-height: 73px;
    background: url("../image/itemBg.gif") no-repeat;
    background-size: 100% 100%;
    color: #fff;
    padding-right: 10px;
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle .news_img{
    width: 106px;
    height: 75px;
    margin: 0 16px 0 16px;
    overflow: hidden;
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle  .msg{
    height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 207px;
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle  .tit{
    color: #4c4c4c;
    font-size: 18px;
    font-weight: bold;
}
.main .news .new_box .new_list .news_item:nth-of-type(2) .new_middle .con{
    color: #4c4c4c;
    font-size: 16px;
}
.main .news .new_box .new_list .news_item:nth-of-type(3) {

}
.main .news .new_box .new_list .news_item:nth-of-type(3) .top_img{
    width: 100%;
    margin-top: 9px;
}
.main .news .new_box .new_list .news_item:nth-of-type(3) P{
    color: #808080;
    font-size: 18px;
    margin-top: 16px;
}
.main .yw{
    width: 100%;
    margin-top: 50px;
}
.main .yw .yw_box .title{
    width: 1320px;
    margin: auto;
    height: 44px;
    line-height: 44px;
    color: #000000;
    font-size: 22px;
    border-bottom: 1px solid   #0058a6;
    margin-bottom: 20px;
}
.main .yw .yw_box {
    width: 1320px;
    margin: auto;
}
.main .yw .yw_box .list{
    display: flex;
    justify-content: space-between;
    width: 1320px;
    margin: auto;
}
.main .yw .yw_box .item{
    width: 310px;
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
}
.main .yw .yw_box .item:hover{
    box-shadow: 10px 10px 10px #ddd;
}
.main .yw .yw_box .item:hover img{
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
}
.main .yw .yw_box .item .top_img{
    width: 100%;
    overflow: hidden;
}
.main .yw .yw_box .item .txt{
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    background-color: #f0f0f2;
}
.main .yw .yw_box .item .txt span{
    font-size: 20px;
    font-weight: bold;
}
.main .yw .yw_box .item .txt  img{
    width: 25px;
    height: 25px;
    
}
.main .yw .yw_box  .hf{
    width: 100%;
    margin: 30px 0;
    display: flex;
    justify-content: space-between;
}
.main .yw .yw_box  .hf .hf_item{
    width: 310px;
    display: flex;
    align-items: center;
}
.main .yw .yw_box  .hf .hf_item:hover .txt1{
    color: #0058a6;
}
.main .yw .yw_box  .hf .hf_item .img{
    width: 60px;
    height: 60px;
}
.main .yw .yw_box  .hf .hf_item .txt{
    margin-left: 20px;
}
.main .yw .yw_box  .hf .hf_item .txt .txt1{
    font-size: 22px;
    font-weight: bold;
}
.main .yw .yw_box  .hf .hf_item .txt .txt2{
    color: #4c4c4c;
    font-size: 16px;
    margin-top: 10px;
}

.main .share{
    width: 100%;
    height: 120px;
    background-color: #e3e3e5;
}
.main .share .share_box{
    width: 1320px;
    margin: auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 22px;
    font-weight: bold;
}
.main .share .share_box .left{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.main .share .share_box .right{
    position: relative;
    width: 340px;
    height: 40px;
    border: 1px solid   #0058a6;
    background-color: #fff;
}
.main .share .share_box .right span{
    position: absolute;
    top: 0;
    right: 0;
    display: block;
    width: 80px;
    height: 40px;
    border-left: 1px solid #0058a6;
}
.main .share .share_box .right span::before{
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 23px;
    display: block;
    transform: translate(-50%,-50%);
    -webkit-transform: translate(-50%,-50%);
    -moz-transform: translate(-50%,-50%);
    -ms-transform: translate(-50%,-50%);
    -o-transform: translate(-50%,-50%);
    background: url("../image/search.jpg") no-repeat;
    background-size: 100% 100%;
}
.main .share .share_box .right input{
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    padding: 10px;
    box-sizing: border-box;
}
.main .share .share_box img{
    width: 22px;
    height: 22px;
    margin-left: 10px;
}
.main .footer{
    width: 100%;
    height: 325px;
    background-color: #a7a7a7;
}
.main .footer .footer_box{
    width: 1320px;
    margin: auto;
    display: flex;
    padding-top: 50px;
    color: #fefefe;
    justify-content: space-between;
}
.main .footer .footer_box .item p:nth-of-type(1){
   color: #fefefe;
   font-size: 20px;
   font-weight: bold;
   margin-bottom: 30px; 
}
.main .footer .footer_box .item p{
    font-size: 16px;
    margin-bottom: 12px;
}
.main .footer_bottom{
    width: 100%;
    height: 67px;
}
.footer_bottom_box{
    color: #808080;
    font-size: 16px;
    width: 1320px;
    margin: auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

标签:box,官网,width,HTML,yw,news,new,main,CSS
From: https://blog.csdn.net/YN2000609/article/details/141561616

相关文章