为什么有两个登录而没有注册呢? 麻烦帮我看看哪里需要改正,有没有需要改进的地方,觉得我写的代码太乱了。。

来源:4-1 编程挑战

a渔

2015-12-11 16:40

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
*{padding:0;
  margin:0;
  }
form{background:lightblue;
     width:200px;
     padding:5px;
     text-align:center;}
.c{margin-bottom:10px;
   width:190px;
   padding:5px;
   text-indent:2em;}
label{font-size:12px;}
a{font-size:12px;
  margin-left:12px;}
p{background-image:url(http://img.mukewang.com/539a972b00013e9102280177.jpg);
  width:190px;
  height:38px;
  margin:10px auto;}
.c2{background-position:0 -38px;
    }
</style>
</head>

<body>
<div>
<form>
    <input class="c" type="text" placeholder="邮箱/手机号/用户名" />
    <input class="c" type="password" placeholder="请输入密码" />
    <input type="checkbox" id="zd" />
    <label for="zd">下次自动登录</label>
    <a href="#">忘记密码?</a>
    <p>
    <botton class="c1"></botton>
    <hr />
    <botton class="c2"></botton>
    </p>
</form>
</div>
</body>
</html>



http://img.mukewang.com/566a8cab00013ef802310249.jpg

写回答 关注

1回答

  • 丶小八戒
    2015-12-11 17:28:42
    已采纳

    首先你通过给<p>标签设置样式来达到这种按钮效果就有所不妥。

    你两个按钮实际上<p>标签显示出来的结果,与button标签无关。(你这理button标签还拼错了,不是botton)

    你可以去掉<p>标签的样式,然后分别定义c1,c2两个按钮的样式,从而达到你想要的效果。

    c1{background-image:url(http://img.mukewang.com/539a972b00013e9102280177.jpg);
      width:190px;
      height:38px;
      margin:10px auto;}
      
      <!--c2你可以改成注册的背景图-->
    c2{background-image:url(http://img.mukewang.com/539a972b00013e9102280177.jpg);
      width:190px;
      height:38px;
      margin:10px auto;}
      
      <button class="c1"></button>
      <hr />
      <button class="c2"></button>

        



    a渔

    非常感谢你~ (div,form的问题当我没问,我也是糊涂了。+_+)

    2015-12-11 17:40:10

    共 2 条回复 >

CSS Sprite雪碧图应用

必学的大型网站实用技术,让你快速掌握CSS Sprite雪碧图技术

47092 学习 · 241 问题

查看课程

相似问题