html css 仿作百度页面

<!DOCTYPE html>
<html lang="zh-CN">
<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>
        .tou {
            font-size: 13px;
            padding-left: 24px;
        }
        .tou a {
            text-decoration: none;
            color: #222;
            padding: 20px;
            display: inline-block;
        }
         .tou a:hover {
            color: blue;
        }
        .tupian {
            text-align: center;
        }
        #sousuo {
            width: 512px;
            height: 40px;
        }
        .text {
            text-align: center;
        }
        #baidu {
            height: 44px;
            width: 108px;
            background-color: #4e6ef2;
            color:white;
        }
        .bottom {
            text-align: center;
            height: 50px;
        }
        #resou {
            font-family: 宋体;
        }
        .diyilie {
            display: inline-block;
        }
        .diyilie a,.dierlie a {
            text-decoration: none;
            color:#222;
        }

        .kong {
            width: 420px;
            display: inline-block;
        }
        .dierlie {
            display: inline-block;
        }
        .diyilie a:hover,.dierlie a:hover {
            color: blue;
        }
        .niu {
            display: inline-block;
            width: 200px;
        }
        .nav {
            width:680px;
            margin: 0 auto;
        }
        li {
            margin:15px;
            list-style: none;
        }

    </style>
</head>
<body>
    <div class="tou">
        <a href="http://news.baidu.com" target="_blank">新闻</a>
        <a href="http://www.hao123.com" target="_blank">hao123</a>
        <a href="http://map.baidu.com" target="_blank">地图</a>
        <a href="http://tieba.baidu.com" target="_blank">贴吧</a>
        <a href="http://haokan.baidu.com" target="_blank">视频</a>
        <a href="http://image.baidu.com" target="_blank">图片</a>
        <a href="http://pan.baidu.com" target="_blank">网盘</a>
        <a href="http://www.baidu.com" target="_blank">更多</a>
    </div>
    <div>
    <div class="tupian"><img src="图片材料/baidu.png"></div>
    <div class="text">
    <span><input type="text" name="sousuok" id="sousuo" ></span><span><input type="submit" name="baiduyixia" id="baidu" value="百度一下"></span>
    </div>
    <div class="nav">
        <ul class="diyilie">
            <li>
                <a href="https://top.baidu.com/board?platform=pc&sa=pcindex_entry" id="resou">百度热搜</a>
                <img src="图片材料/biaoqian1.png">
            </li>
            <li>
                <image src="图片材料/biaoqian.png">
               <a href="#">重要之年看开年</a> 
            </li>
            <li>
                <a href="#">1 全国疫情整体继续呈现下降态势</a>
            </li>
            <li>
                <a href="#">2 上海新增本土194+1487 死亡1例</a>
            </li>
        </ul>
        <ul class="dierlie">
            <li>
                <span class="niu"></span>
                <span>
                    <img src="图片材料/biaoqian2.png" >
                    <a href="#">换一换</a>
                </span>
            </li>
            <li>
                <a href="#">3 全国疫情整体继续呈现下降态势</a>
                热
            </li>
            <li>
                <a href="#">4 清华大学:今起校门不进不出</a>
            </li>
            <li>
                <a href="#">5 国产大飞机C919首飞成功</a>
            </li>
        </ul>
    </div>
</body>
</html>

以上为代码区,

效果图如下:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
很好!以下是一个简单的示例,可以帮助你入门。 首先,我们需要一个HTML文件,命名为index.html。在这个文件中,我们将建立一个基本的网站结构,并添加一些内容和样式。 ```html <!DOCTYPE html> <html> <head> <title>苹果官网</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <!-- 导航栏 --> <nav> <ul> <li><a href="#">iPhone</a></li> <li><a href="#">iPad</a></li> <li><a href="#">MacBook</a></li> <li><a href="#">Watch</a></li> <li><a href="#">Music</a></li> <li><a href="#">支持</a></li> <li><a href="#">搜索</a></li> <li><a href="#">购物袋</a></li> </ul> </nav> <!-- 主要内容 --> <main> <section class="hero"> <h1>欢迎来到苹果</h1> <p>探索我们的产品</p> <button>了解更多</button> </section> <section class="products"> <h2>我们的产品</h2> <ul> <li> <img src="iphone.jpg"> <h3>iPhone</h3> <p>购买最新的iPhone</p> </li> <li> <img src="ipad.jpg"> <h3>iPad</h3> <p>购买最新的iPad</p> </li> <li> <img src="macbook.jpg"> <h3>MacBook</h3> <p>购买最新的MacBook</p> </li> <li> <img src="watch.jpg"> <h3>Watch</h3> <p>购买最新的Watch</p> </li> </ul> </section> </main> <!-- 页脚 --> <footer> <p>© 2021 苹果公司</p> </footer> </body> </html> ``` 接下来,我们需要一个CSS文件,命名为style.css。在这个文件中,我们将为网站添加样式。 ```css /* 设置全局样式 */ body { margin: 0; padding: 0; font-family: Arial, sans-serif; } /* 导航栏样式 */ nav { background-color: #333; color: #fff; padding: 10px; } nav ul { margin: 0; padding: 0; list-style: none; display: flex; justify-content: space-between; align-items: center; } nav ul li { margin: 0 10px; } nav ul li a { color: #fff; text-decoration: none; } /* 主要内容样式 */ main { padding: 50px; } .hero { background-image: url(hero.jpg); background-size: cover; background-position: center; height: 500px; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; text-align: center; } .hero h1 { font-size: 50px; margin: 0; } .hero p { font-size: 20px; margin: 20px 0; } .hero button { background-color: #fff; color: #333; padding: 10px 30px; border: none; border-radius: 5px; font-size: 20px; cursor: pointer; } .products { display: flex; flex-wrap: wrap; justify-content: space-between; } .products h2 { font-size: 30px; margin: 0; padding: 20px 0; } .products ul { margin: 0; padding: 0; list-style: none; } .products li { margin: 20px; width: 300px; text-align: center; } .products li img { width: 100%; height: auto; } .products li h3 { font-size: 24px; margin: 10px 0; } .products li p { font-size: 16px; margin: 0; } /* 页脚样式 */ footer { background-color: #333; color: #fff; padding: 10px; text-align: center; } ``` 这是一个简单的示例,你可以根据自己的需求和喜好进行修改和扩展。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

20岁扶墙码农

谢谢支持

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值