代码之家  ›  专栏  ›  技术社区  ›  user879

Html输入类型“email”和输入类型“number”不同于输入类型“text”的样式

  •  -1
  • user879  · 技术社区  · 7 年前

    我请求以下表单中的帮助以修复样式问题。(我不是程序员,只是在尝试)

    这是代码

    <form action="success.php" method="post" >
    <input type="text" name="Name" placeholder="Your name..." required /><br />
    <input type="number" name="Phone" placeholder="Phone Number" required title="Valid phone number (Without + marks)"/><br />
    <input type="email" name="Email" placeholder="Email Address" required title="Valid Email Format:example@example.com" /><br />
    <textarea name="Message" placeholder="Your Message" required /></textarea><br /><br />
    <input type="submit" value="Send my Quote Request" id="submit_footer" /><br />
    </form>
    

    这是输出。。

    enter image description here

    具有不同格式的 输入类型=“编号” 输入类型=“电子邮件” . (

    <input type="number" name="Phone" placeholder="Phone Number" required title="Valid phone number (Without + marks)"/><br />
    <input type="email" name="Email" placeholder="Email Address" required title="Valid Email Format:example@example.com" /><br />
    

    )

    输入类型=“文本” 是ok格式/样式。( <input type="text" name="Name" placeholder="Your name..." required /><br /> )

    我希望有相同的格式,这是用于输入类型“电子邮件”和“数字”。

    即使使用谷歌也无法理解。任何帮助都将不胜感激。

    韩元

    附言

    样式表页脚

    /*--------------------------------------------------footer--------------------------------*/
    .footer
    {
    
        background:#00234d;
        padding:50px 0px;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    .footer h3
    {
        color:#FFFFFF;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    .footer input[type='text']
    {
        width:251px;
        height:33px;
        padding-left:15px;
        border:2px solid #919191;
        outline:0px;
        color:#919191;
        margin-bottom:15px;
        background:transparent;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    .footer textarea
    {
        width:251px;
        padding-top:10px;
        padding-left:15px;
        background:transparent;
        height:85px;
        padding-bottom:15px;
        border:2px solid #919191;
        outline:0px;
        color:#919191;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
        font-size:14px;
    
    }
    #submit_footer {
      color: #00aceb;
      font-size: 14px;
      outline:0;
      font-weight: 800;
      text-transform: uppercase;
      background:transparent;
      width:270px;
      text-decoration: none;
      padding: 5px 10px;
      border: 3px solid #00aceb;
      transition: all .5s !important;
      cursor:pointer;
      -webkit-transition: all .5s !important;
      -o-transition: all .5s !important;
      -ms-transition: all .5s !important;
      -moz-transition: all .5s !important;
      background: linear-gradient(to left, transparent 50%, #009ad6 50%);
        background-size: 200% 100%;
        background-position:right bottom;
    }
    #submit_footer:hover
    {
         background-position:left bottom;
         color:#FFF;
    }
    .w_float
    {
        float:left;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
          margin-top: 90px;
    }
    .w_float p
    {
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
        color:#c3c7c8;
    }
    .w_float ul
    {
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
        margin:0;
        padding:0px;
    }
    .w_float ul li
    {
        list-style:none;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
        background:url(../images/true_arrow.png) no-repeat left 5px;
        color:#c3c7c8;
        font-size:14px;
        padding:0px 30px;
        margin-bottom:15px;
    }
    .s li
    {
        background:url(../images/privacy_safe.png) no-repeat left 5px !important;
          padding: 0px 40px !important;
          transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    .w_float2 ul
    {
        margin:0;
        padding:0px;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    .w_float2 ul li
    {
        list-style:none;
    
        background-image:url(../images/footer_ul.png);
        background-repeat:no-repeat;
        color:#FFFFFF;
        font-size:18px;
        padding:0px 30px;
        margin-bottom:15px;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
        font-weight:600;
    }
    .w_float2 ul li:nth-child(2)
    {
        background-position:0px -51px;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    .w_float2 ul li a
    {
    
        color:#FFFFFF;
        font-size:18px;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
        font-weight:600;
    } 
    
    3 回复  |  直到 7 年前
        1
  •  4
  •   keshav khandelwal    7 年前

    .footer input[type='email']
    {
        width:251px;
        height:33px;
        padding-left:15px;
        border:2px solid #919191;
        outline:0px;
        color:#919191;
        margin-bottom:15px;
        background:transparent;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    
        .footer input[type='number']
    {
        width:251px;
        height:33px;
        padding-left:15px;
        border:2px solid #919191;
        outline:0px;
        color:#919191;
        margin-bottom:15px;
        background:transparent;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
        2
  •  3
  •   Bhuwan    7 年前

    因为您只在上应用了css .footer input[type='text'] ...您需要向提供相同的css input[type='number'] input[type='email'] 喜欢

    .footer input[type='text'],
    .footer input[type='email'],
    .footer input[type='number'] {
      width: 251px;
      height: 33px;
      padding-left: 15px;
      border: 2px solid #919191;
      outline: 0px;
      color: #919191;
      margin-bottom: 15px;
      background: transparent;
      transition: all .5s !important;
      -webkit-transition: all .5s !important;
      -o-transition: all .5s !important;
      -ms-transition: all .5s !important;
      -moz-transition: all .5s !important;
    }
    

    ...或者另一种解决方案是,我建议在所有输入类型中使用相同的类,比如 input-control 喜欢

    HTML

    <input class="input-control" type="text" name="Name" placeholder="Your Name" required/><br />
    <input class="input-control" type="number" name="Phone" placeholder="Phone Number" required title="Valid phone number (Without + marks)"/><br />
    <input class="input-control" type="email" name="Email" placeholder="Email Address" required title="Valid Email Format:example@example.com" /><br />
    

    CSS

    .footer .input-control {
      width: 251px;
      height: 33px;
      padding-left: 15px;
      border: 2px solid #919191;
      outline: 0px;
      color: #919191;
      margin-bottom: 15px;
      background: transparent;
      transition: all .5s !important;
      -webkit-transition: all .5s !important;
      -o-transition: all .5s !important;
      -ms-transition: all .5s !important;
      -moz-transition: all .5s !important;
    }
    
        3
  •  2
  •   Athul Nath    7 年前
    .footer input[type='text'] ,
    .footer input[type="email"] ,
    .footer input[type="number"]
    {
        width:251px;
        height:33px;
        padding-left:15px;
        border:2px solid #919191;
        outline:0px;
        color:#919191;
        margin-bottom:15px;
        background:transparent;
        transition:all .5s !important; -webkit-transition:all .5s !important;-o-transition:all .5s !important;-ms-transition:all .5s !important;-moz-transition:all .5s !important;
    }
    

    在css中替换此