css基础-水平居中练习-相关demo案例-源码

demo

在这里插入图片描述

<!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>
    <style>
.wen{
    
    
    margin: auto;
    width: 500px;
    height: 1000px;
    /* text-align:center; */
    
}
h3{
    
    
    text-align:center
}
.bb{
    
    
    text-align:center
}
.bt
{
    
    
    color: rgb(151, 161, 161);
    font-size: 10px;

}
.by{
    
    
    color: rgb(33, 224, 224);
    font-size: 10px;
  
}
a{
    
    
    text-decoration: none;
    font-size: 10px;
    
}
p{
    
    
    text-indent:2em;
}
    </style>
</head>
<body>
    <div class="wen">
    <h3>
        《自然》评选改变科学的10个计算机代码项目
    </h3>
    <div class="bb">
    <span class="bt">
2077012814:58      
    </span>
    <span class="by">
      新浪科技        
    </span>
    <a href="#">
         收藏本文        
     </a>
    </div>
    <hr>
    <P>
        今天凌晨国足结束了与阿曼的较量,双方最终1-1战成平局各拿1分。虽然今天晚上中国队总体的表现还是令人满意的,但是李铁今晚在球场边临场指挥却引发了巨大争议。3镜头告诉李铁,洛国富不该在第67分钟就被换下。
    </P>
    <P>
        本场比赛第25分钟,洛国富和阿兰在禁区形成配合。阿兰在禁区左侧起脚传中,找到后点的洛国富。洛国富高高跃起抢到头球并且完成了攻门。从慢镜头看出洛国富这个球顶的非常好,力量以及角度都堪称完美,可惜的是对方门将这个时候注意力以及反应也非常不错。 </P>
        <P>43分钟,已经到了上半场临近结束的时间。阿曼队在落后1球的情况下一直在对中国队进行猛攻。从慢镜头看出,对方在禁区当中完成了一脚颇具威胁的倒钩射门,吓得中国队一身冷汗。好在洛国富门前选位非常好,在门线完成了神奇解围。 </P> 
        </div>
</body>
</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>Document</title>
</head>
<style>
    .father{
    
    
        background-color: rgb(207, 198, 183);
        width: 500px;
        height: 500px;
        margin:0 auto;
    }
    .son{
    
    
        background-color: #fff;
        width: 234px;
        height: 300px;
        margin: 0 auto;
        text-align: center;
    }
    img{
    
    
        margin: top 50px; ;
        width: 160px;
        height: 180px;
        padding-top: 20px;
    
    }
    .strong{
    
    
        font-weight: bold;
    }
    .title{
    
    
        color: rgb(165, 165, 175);
        font-size:16px ;
    }
    .price{
    
    
        padding-top:10px;
        color: rgb(243, 143, 107);
        font-size: 14px;
        
    }
</style>
<body>
    <div class="father">
<div class="son">
<img src="641.jpeg"  />
<div class='strong'>九号平衡车</div>
<div class="title">玩具</div>
<div class="price">1999</div>
</div>
    </div>
</body>
</html>

相关知识点链接

https://blog.csdn.net/faith_girl/article/details/121284305

猜你喜欢

转载自blog.csdn.net/faith_girl/article/details/121289601
今日推荐