仿造百度前端代码——出现的问题解决方式

这是一个HTML代码示例,展示了百度搜索主页的基本布局和样式。代码中包含了头部菜单、搜索框和底部链接的结构。网页设计注重对齐和简洁,包括糯米、新闻等链接,以及输入框和搜索按钮的样式。页面还提及了设置主页、关于百度和百度推广等相关信息。
摘要由CSDN通过智能技术生成

在这里插入图片描述


```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>

    <style type="text/css">
        body {
            height: 100%;
            width: 100%;
            margin: 0;
            padding: 0;
        }

        .main {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        .menu {
            text-align: right;
        }

        a {
            text-decoration: none;
        }

        .middle {
            text-align: center;
            width: 100%;
            height: 100px;
            margin-top: 130px;
        }


        .input {
            border: 1px solid #b6b6b6;
            width: 474px;
            height: 36px;
            height: 36px;
            font-size: 20px;
        }

        .img {
            align: middle;
            border: 0;
            width: 275px;
            height: 140px;
        }

        .submit {
            background-color: #3385ff;
            height: 38px;
            font-size: 20px;
            color: white;
            border: 0
        }
    </style>


</head>

<body>


    <div style="text-align: right;">
        <div class="menu">
            <a href="http://www.nuomi.com/cid=002540">糯米</a>
            <a href="http://news.baidu.com">新闻</a>
            <a href="http://www.hao123.com">hao123</a>
            <a href="http://map.baidu.com">地图</a>
            <a href="http://v.baidu.com">视频</a>
            <a href="http://tieba.baidu.com">贴吧</a>
            <a href="https://passport.baidu.com/v2/?login&amp;tpl=mn&amp;u=http%3A%2F%2Fwww.baidu.com%2F">登录</a>
            <a href="http://www.baidu.com/gaoji/preferences.html">设置</a>
            <a href="http://www.baidu.com/more/">更多产品</a>
        </div>
    </div>

    <!-- 第二个div  -->
    <div class="middle">
        <form action="http://www.baidu.com/baidu">
            <a href="https://www.baidu.com/" target="_blank" align="center">
                <img src="https://www.baidu.com/img/bd_logo1.png" alt="baidu" class="img">
            </a>
            <br>
            <input type="text" class="input" name="word">
            <input type="submit" value="百度一下" class="submit" href="https://www.baidu.com/">
        </form>
    </div>
    <div>
        <div align="center" style="bottom: 0;margin-top: 300px;">

            <a id="setf" href="//www.baidu.com/cache/sethelp/help.html" target="_blank">把百度设为主页</a>
            <a href="http://home.baidu.com">关于百度</a>
            <a href="http://ir.baidu.com">About baidu</a>
            <a href="http://e.baidu.com/?refer=888">百度推广</a>
            <p>2016&nbsp; baidu &nbsp;<a herf="http://www.baidu.com/duty/">使用百度前必读 意见反馈 京ICP证030173号</a></p>
            <a href="">京公网安备11000002000001号</a>
        </div>
    </div>

</body>

</html>

 1. VScode不要随便乱装插件,尤其是自动对齐,出现了大问题十分的鸡肋。
 2. 前端代码熟能生巧。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当然可以!下面是一个简单的安卓仿造QQ登录注册功能的代码示例: 1. 创建一个名为MainActivity的主活动类,用于处理用户界面和逻辑。 ```java public class MainActivity extends AppCompatActivity { private EditText usernameEditText; private EditText passwordEditText; private Button loginButton; private Button registerButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); usernameEditText = findViewById(R.id.usernameEditText); passwordEditText = findViewById(R.id.passwordEditText); loginButton = findViewById(R.id.loginButton); registerButton = findViewById(R.id.registerButton); loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String username = usernameEditText.getText().toString(); String password = passwordEditText.getText().toString(); // 在这里处理登录逻辑 } }); registerButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String username = usernameEditText.getText().toString(); String password = passwordEditText.getText().toString(); // 在这里处理注册逻辑 } }); } } ``` 2. 创建一个名为activity_main.xml的布局文件,用于定义用户界面。 ```xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="16dp" tools:context=".MainActivity"> <EditText android:id="@+id/usernameEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="用户名" /> <EditText android:id="@+id/passwordEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="密码" android:inputType="textPassword" /> <Button android:id="@+id/loginButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="登录" /> <Button android:id="@+id/registerButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="注册" /> </LinearLayout> ``` 这是一个简单的示例,你可以根据自己的需求进行修改和扩展。希望对你有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值