简单实现百度页面

百度页面的实现

    <style>
        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            /*小于最小宽度*/
            min-width: 1000px;
        }

        img {
            vertical-align: bottom;
        }

        header {
            padding: 20px 10px;
            overflow: auto;
        }

        header nav {
            /*浮动*/
            float: right;
            font-size: 14px;
        }

        nav .nav-item {
            color: #333;
            margin-right: 15px;

        }

        nav .nav-item:hover {
            color: #00c;
        }

        nav .more {
            color: white;
            background-color: #38f;
            padding: 8px;
        }

        form {
            width: 640px;
            /*定宽居中,适用于块标签剧中*/
            margin: 50px auto 0;
        }

        form .logo {
            /*1.默认行内标签的格式,高度不能被撑开
             2.切换成块标签,方便居中
           */
            display: block;
            width: 250px;
            margin: 0 auto 20px;
        }

        form .logo img {
            width: 250px;
        }

        .from-group input,
        .from-group label {
            display: block;

        }

        .from-group label {
            width: 540px;
            height: 35px;
            float: left;
            position: relative;
        }

        .from-group label .text {
            height: 35px;
            width: 100%;
            border: 1px solid #ddd;
            border-right: none;
            padding: 0 40px 0 8px;
        }

        /*:focus 获取焦点,一般用于表单标签,选中输入内容时*/
        .from-group label .text:focus {
            border-color: #38f;
            /*去除轮廓线,专用于谷歌*/
            outline: none;
        }

        .from-group label .camera {
            position: absolute;
            right: 10px;
            top: 10px;
            width: 18px;
            height: 19px;
            background-image: url('img/camera.png');
            background-repeat: no-repeat;
        }

        .from-group label .camera:hover {
            background-position: center -20px;
        }

        .from-group .submit {
            width: 100px;
            height: 35px;
            margin-left: 540px;
            color: white;
            background-color: #38f;
            border: none;
            cursor: pointer;
        }

        .from-group .submit:hover {
            box-shadow: 0 0 50px rgba(0, 0, 0, 0.2) inset;
        }

        .app {
            width: 300px;
            margin: 100px auto 0;
            /*针对图片和文字左右居中,在对应的父标签中添加此样式*/
            text-align: center;
        }

        .app .ewm {
            border: 1px solid #ddd;
            padding: 8px;
        }

        .app .ewm-info {
            /*增加字间距*/
            letter-spacing: 5px;
            margin: 5px 0;
        }

        .app .app-slogan {
            font-size: 14px;
            color: #666;
        }

        footer {
            width: 1000px;
            margin: 20px auto 0;
            text-align: center;
            color: #666;
            font-size: 14px;
        }

        footer a {
            /*继承色,使用父标签的颜色*/
            color: inherit;
        }

        .bd-actions,
        .copyright-safe {
            padding: 5px 0;
        }

        .bd-actions a,
        .copyright-safe .gutter {
            margin: 0 10px;
        }

        .copyright-safe .icon {
            width: 20px;
            height: 20px;
        }
    </style>
</head>

<body>
    <!--头部标签-->
    <header>
        <!--导航标签 navigation-->
        <!--在使用选择器时,尽可能少用标签选择器-->
        <nav>
            <a href="#" class="nav-item"><b>新闻</b></a>
            <a href="#" class="nav-item"><b>hao123</b></a>
            <a href="#" class="nav-item"><b>地图</b></a>
            <a href="#" class="nav-item"><b>视频</b></a>
            <a href="#" class="nav-item"><b>贴吧</b></a>
            <a href="#" class="nav-item"><b>学术</b></a>
            <a href="#" class="nav-item"><b>登录</b></a>
            <a href="#" class="nav-item"><b>设置</b></a>
            <span class="more">更多产品</span>
        </nav>
    </header>
    <!--表单区域-->
    <form>
        <!--title 属性:任何一个可见标签都可以使用,鼠标悬停
            稍等待一会儿就会显示,一般用于提示信息-->
        <a href="#" class="logo" title="国际emoji日">
            <img src="img/emo.gif" alt="emoji">
        </a>
        <div class="from-group">
            <!--文本输入框-->
            <label>
                <input type="text" class="text">
                <div class="camera"></div>
            </label>
            <!--提交按钮-->
            <input type="submit" value="百度一下" class="submit">
        </div>
    </form>
    <!--app推广-->
    <div class="app">
        <img src="img/erweima.png" alt="百度app" class="ewm">
        <div class="ewm-info">下载百度app</div>
        <!--转义字符-->
        <div class="app-slogan">有事搜一搜&#x3000;没事看一看</div>
    </div>
    <!--页脚区域-->
    <footer>
        <div class="bd-actions">
            <a href="#">把百度设为主页</a>
            <a href="#">关于百度</a>
            <a href="#">About&nbsp;Baidu</a>
            <a href="#">百度推广</a>
        </div>
        <div class="copyright-safe">
            <span class="gutter">©2019 Baidu
                <a href="#">使用百度前必读</a>
                <a href="#">意见反馈</a>
                京ICP证030173号
            </span>
            <a href="#" class="gutter">
                京公网安备11000002000001号
                <img src="img/sign.png" class="icon" alt="">
            </a>
        </div>
    </footer>
</body>


在这里插入图片描述

以下是一个简单的 HTML 实现百度注册登录页面的示例代码: ```html <!DOCTYPE html> <html> <head> <title>百度注册登录页面</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> body { font-family: Arial, sans-serif; background-color: #f2f2f2; } #container { width: 400px; margin: 0 auto; background-color: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); padding: 20px; border-radius: 5px; } h1 { text-align: center; font-size: 24px; } input[type="text"], input[type="password"] { width: 100%; padding: 10px; margin-bottom: 20px; border: none; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } input[type="submit"] { width: 100%; padding: 10px; background-color: #3385ff; border: none; border-radius: 5px; color: #fff; font-size: 16px; cursor: pointer; transition: background-color 0.2s ease-in-out; } input[type="submit"]:hover { background-color: #1a73e8; } </style> </head> <body> <div id="container"> <h1>百度账号注册登录</h1> <form> <label for="username">用户名</label> <input type="text" id="username" name="username" required> <label for="password">密码</label> <input type="password" id="password" name="password" required> <input type="submit" value="登录"> </form> <p>还没有账号?<a href="#">立即注册</a></p> </div> </body> </html> ``` 这段代码实现一个简单百度注册登录页面,包括一个标题、一个登录表单和一个注册链接。你可以根据实际需求进行修改和扩展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值