A simple web page made by html css (for practice)

 Code picture is here:

<!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>Document</title>
    <!-- 引入清除浏览器默认样式的文件 -->
    <link rel="stylesheet" type="text/css" href="../reset.css"/>
    <link rel="stylesheet" type="text/css" href="./css/index.css"/>
  
</head>
<body>
    <!-- 命名规范 id class 使用英文 
    冥冥格式 首字母小写  每个字母开头字母大写-->
    <!-- 顶部 -->
    <div class="header w">
        
            <ul class="nav">
                <li><a href="#">HOME</a><br>
                     <span>Back to home</span>
                    </br>
                    <li><a href="#">PRODUCTS</a><br>
                        <span>What we have for you</span>
                       </br>
                       <li><a href="#">SERVICES</a><br>
                        <span>Things we do</span>
                       </br>
                       <li><a href="#">BLOG</a><br>
                        <span>Fallow our updates</span>
                       </br>
                       <li><a href="#">CONTACT</a><br>
                        <span>Ways to reach us</span>
                       </br>
            </ul>
            <div class="logo">
                <a href="#" title="一个好网站">
                    <img src="images/img/logo.png" alt="网站的logo">
                </a>
            
        </div>
       
    </div>
    <!-- 导航区 -->
    <div class="banner w">
        <img src="images/img/banner/banner01.png" alt="这是标题">
        <!-- 放导航按钮 -->
        <div class="pointDiv">
            <a href="#"></a>
            <a href="#" class="active"></a>
            <a href="#"></a>
            <a href="#"></a>
            <a href="#"></a>
        </div>
    </div>
    <!-- 内容 (三个内容不能撑开父元素导致高度塌陷)-->
    <div class="content w clearfix">
        <h1 >Lorem ipsum dolor sit amet, consectetur adipisicing elit</h1>
        <!-- 内容1 -->
        <div class="p1">
            <a class="mm" href="#">Perfect Logic</a><br>
             <p class="p3">All you want your website to do.</p>
             <!-- 创建图片的div -->
             <div class="imgDiv">
                 <img src="./images/img/pic/pic1.jpg" alt="p1">
                </div>
             
             <p class="text">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. 

             </p>
             <a class="lm" href="#">Learn More</a>
        </div>
        <!-- 内容2 -->
        <div class="cs">
            <a class="mm" href="#">Complete Solution</a><br>
             <p class="p3">A tool anything and everything you can think</p>
             <div class="imgDiv">
                <img src="./images/img/pic/pic2.jpg" alt="p1">
               </div>
             <p class="text">Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciun tdolore magnam aliquam quaerat voluptatem.</p>
             <a class="lm" href="#">Learn More</a>
            </div>
        <!-- 内容3 -->
        <div class="uc">
            <a class="mm" href="#">Uber Culture</a><br>
             <p class="p3">Fresh. Modern and ready for future b</p>
             <div class="imgDiv">
                <img src="./images/img/pic/pic3.jpg" alt="p1">
               </div>
             <p class="text">Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
             <a class="lm" href="#">Learn More</a>
            </div>
        
    </div>
     <!-- 联系部分 -->
     <div class="contack w clearfix"">
        <!-- 板块1 -->
        <div class="so">
            <h1 class="cText">Social Connection</h1>
            <p class="it">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium</p>
            <!-- 设置小图标 -->
            <div class="icon">
                <a href="#"><img src="./images/img/rss.png" alt=""></a>
                <a href="#"><img src="./images/img/fb.png" alt=""></a>
                <a href="#"><img src="./images/img/in.png" alt=""></a>
                <a href="#"><img src="./images/img/yt.png" alt=""></a>
                <a href="#"><img src="./images/img/fb.png" alt=""></a>
            </div>
            <h2 >Newsletter</h2>
            <p class="it">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium</p>
            <form action="#">
          
                <input type="text" placeholder="your email address" class="email">
                
                <button class="btn">Send it</button></form>
        </div>
        <!-- 板块2 -->
        <div class="co">
            <h1 class="cText">Contact</h1>
            <form action="#">
            <input type="text" placeholder="your name" id="name">
            <input type="text" placeholder="your email address" class="email">
            <textarea placeholder="message" id="message" cols="30" rows="10"></textarea>
            <button class="btn">Send it</button>
        </form>
        </div>
        <!-- 板块3 -->
        <div class="ne">
         <h1 class="cText">News Updates</h1>
         <p class="it1">
            <img src="./images/img/pic/1.gif" alt="">
            <p class="it">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
            
         </p>
         <p class="it1">
            <img src="./images/img/pic/2.gif" alt="">
            <p class="it">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
            
         </p>
         <p class="it1">
            <img src="./images/img/pic/3.gif" alt="">
            <p class="it">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
            
         </p>
         <button class="btn">Visit our Blog</button>
     </div>
    </div>

    <!-- footer -->
   <div class="footer">
         <div class="w">
             
                <p class="fc">  Copyright 2010. Studio VIVROCKS. All Rights Reserved.</p>
                <p class="ft">Site Powered by Wordpress. Design and Developed by VIVROCKS.</p>

             <p class="ft"><a href="#"> Home</a> | <a href="#">About</a> | <a href="#">Products</a> | <a href="#">Services</a> |<a href="#"> Contact</a></p>
                
                <p class="ft"> <a href="#"> Privacy Policy</a> | <a href="#">Terms of use</a></p>
         </div>
   </div>
</body>
</html>

css

/* 设置水平方向平铺 */
body{
    background: url(../images/img//bd-bg.png) repeat-x;
    /* height: 3000px; */
}
.w{
    width: 940px;
    margin: 0  auto;
}
.header{

    padding-top: 37px;
    
    padding-bottom: 46px;
}
.logo{
    padding-left:15px;

}
.nav{
    float: right;
    padding-top: 20px;
    padding-bottom: 46px;
    
}
.nav li{
    float: left;
    padding:0  10px;
    border-left: #d6d6d6 1px dotted;
}
.nav a{
    color:  #666666;
    font: bold 14px  "Georgia";
    text-decoration: none;
}
.nav span{
    color: #b7b7b7;
    font:11px "Tahoma";
}
.nav a:hover{
    color: #c7c5c5;
    text-decoration: underline;
}
.banner{
  
    height: 356px;
    background: url(../images/img/banner-bg.png) no-repeat bottom center;
    position: relative;
}
.pointDiv{
    position: absolute;
    left: 15px;
    top: 314px;

}
.pointDiv a{
    float: left;
    height: 17px;
    width: 17px;
    margin-left: 4px;
    background: url(../images/img/pointer.png) no-repeat;
}
.pointDiv .active,
.pointDiv a:hover{
    background: url(../images/img/pointer-active.png) no-repeat;
}
.content{
    /* background-color: #c3b8ec; */
    background: url(../images/img/line.png) no-repeat bottom center;
}
.content h1{
    padding: 6px 0 20px 0;
    margin-bottom: 38px;
    text-align: center;
    font: bold 24px Georgia;
    background: url(../images/img/line.png) no-repeat bottom center;
    
}
.content  .p1,.content  .cs,.content  .uc,
.contack .so,.contack .co,.contack .ne{
    /* background-color: #666666; */
    width: 300px;

    float: left;
}
.content  .p1,.content  .cs,.content  .uc, .mm{
    color: #11719e;
    font: 21px Georgia;
    text-decoration: none;
    
}
.content .mm:hover{
    color: #c3b8ec;
}
.content  .p3{
    color: #3e3e3e;
     font: 12px Helvetica;
}
.content .cs,.contack .co{
    margin: 0 20px;
}
/* 解决高度塌陷 */
.clearfix:before,
.clearfix:after{
    content: "";
    display: table;
    clear: both;
}
.clearfix{
    zoom: 1;
}
.content .text {
    color: #3e3e3e;
    font: 13px Helvetica;
    
}
.content .imgDiv{
    width: 299px;
    height: 202px;
    margin-top: 23px;
    margin-bottom: 23px;
    background: url(../images/img/img-bg.png) no-repeat;
    position: relative;
}
.content img{
    margin-top: 12px;
    margin-left: 8px;
    margin-bottom: 23px;
}
.content .lm {
    display: block;
    width: 163px;
    height: 40px;
    color: #428fb2;
    font: 12px Helvetica;
    text-decoration: none;
    background: url(../images/img/btn1.png) no-repeat;
    padding-left: 17px;
    padding-top: 11px;
    margin-top: 12px;
    margin-bottom: 35px;
}
.contack{
    margin-top: 42px;
    margin-bottom: 24px;
}
.contack .cText{
    color: #444444;
    font: 18px Georgia;
    padding-bottom: 10px;
    border-bottom: 1px #d3d3d3 dashed;
}
.contack .so,.contack .co,.contack .ne{
/*    
    background-color: #11719e; */
}
.contack .it{
    font: 12px Helvetica;
    padding-top: 14px;
}
#name{
    margin-top: 17px;
    background: url(../images/img/input.png) no-repeat;
    width: 276px;
    height: 33px;
    border: none;
    padding: 0  10px;
  
   line-height: 33px;
   /* 单独为ie6设置的 背景不随元素滚动 */
   _background-attachment: fixed;
}
.email{
    
    background: url(../images/img/input.png) no-repeat;
    width: 276px;
    height: 33px;
    border: none;
    padding: 0 10px;
    line-height: 33px;
    margin-bottom: 16px;
    _background-attachment: fixed;
    margin-top: 15px;
}
#message{
    line-height: 33px;
    width: 276px;
    height: 133px;
    border: none;
    background: url(../images/img/textarea.png) no-repeat ;
    _background-attachment: fixed;
    overflow: hidden;
    resize: none;
    padding: 10px;
    margin: 0;
}
.contack .btn{
    border: none;
   background: url(../images/img/btn2.png) no-repeat;
   width: 160px;
    height: 32px;
    margin-top: 11px;
    color: aliceblue;
    margin-left: 5px;
    padding: 0 ;
    margin-bottom: 23px;
    text-align: left;
    text-indent: 1em;
    cursor: pointer;
}
.so .icon{
    margin-top: 10px;
    font-size: 0px;
    margin-bottom: 36px;
   
}
.so .icon a{
    margin-right: 6px;
}
h2{
    color: #444;
    font: bold 18px Helvetica;
    border-bottom: 1px #d3d3d3 dashed;
}
.ne .it{
    color: #444;
    font: 12px/1 helvetica;
    height: 58px;
    border-bottom: 1px #d3d3d3 dashed;
    margin-top: 15px;
}
.ne img{
   float: left;
   margin-top: 15px;
   margin-right: 9px;
}
.ne .btn{
     margin-top: 16px;
}
.uc .lm{
    margin-top: 28px;
}
.footer{
    height: 173px;
    background: #333333;
    border-top: 10px solid #4c4c4c;
}
.ft,.footer a{
    color: #838383;
    font: 11px/1 "Myriad Pro";
    text-decoration: none;
   margin-top: 18px;
   
}
.footer p{
    margin-left: 18px;
    margin-right: 23px;
}
.footer .fc{
    float: right;
    color: #838383;
    font: 11px/1 "Myriad Pro";
   
}
.footer a:hover{
    color: #b7b7b7;
}

The pictures are linked here:

https://pan.baidu.com/s/1hRv6V0GJMcUoMWfB8rry5A
Extraction code: gex4
-- sharing from Baidu Netdisk Super Member V1

Guess you like

Origin blog.csdn.net/qq_63533863/article/details/123350780