复选框、单选框、placeholder样式修改

<!DOCTYPE html>
<html>

  <head>
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript" src="js/jquery-3.2.1.js"></script>
    <style type="text/css">
      .wrapped input[type='checkbox'] {
        width: 20px;
        height: 20px;
        background: url(img/check.png) no-repeat;
        background-size: 100%;
        -webkit-appearance: none;
        outline: none;
      }
      
      .wrapped input[type=checkbox]:checked {
        background: url(img/checked.png) no-repeat;
        background-size: 100%;
      }
      
      .wrapped input[type='radio'] {
        width: 20px;
        height: 20px;
        background: url(img/checked.png) no-repeat;
        background-size: 100%;
        -webkit-appearance: none;
        outline: none;
      }
      
      .wrapped input[type=radio]:checked {
        background: url(img/check.png) no-repeat;
        background-size: 100%;
      }
      
      .wrapped ::-webkit-input-placeholder {
        /* WebKit browsers */
        color: red;
        font-size: 16px;
      }
      
      .wrapped ::-moz-placeholder {
        /* Mozilla Firefox 19+ */
        color: red;
        font-size: 16px;
      }
      
      .wrapped :-moz-placeholder {
        /* Mozilla Firefox 4 to 18 */
        color: red;
        font-size: 16px;
      }
      
      .wrapped :-ms-input-placeholder {
        /* Internet Explorer 10+ */
        color: red;
        font-size: 16px;
      }
    </style>
  </head>

  <body>
    <div class="wrapped">
      <p>
        <label>checkbox</label>
        <input type="checkbox" />one
      </p>
      <p>
        <label>radio</label>
        <input type="radio" name="fruit" />苹果
        <input type="radio" name="fruit" />香瓜
        <input type="radio" name="fruit" />火龙果
        <input type="radio" name="fruit" />百香果
        <input type="radio" name="fruit" />哈密瓜
      </p>
      <p>
        <label>placeholder</label>
        <input type="text" placeholder="我想要变红色" />
      </p>
    </div>
  </body>

</html>

转载于:https://my.oschina.net/missZhuo/blog/1860492

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个包含单选框复选框,输入框,下拉菜单和提交按钮的 Bootshape 表单的示例代码: ```html <form> <div class="form-group"> <label for="nameInput">Name</label> <input type="text" class="form-control" id="nameInput" placeholder="Enter your name"> </div> <div class="form-group"> <label for="emailInput">Email address</label> <input type="email" class="form-control" id="emailInput" placeholder="Enter your email address"> </div> <div class="form-group"> <label for="genderInput">Gender</label> <div class="form-check"> <input class="form-check-input" type="radio" name="genderInput" id="maleRadio" value="male"> <label class="form-check-label" for="maleRadio"> Male </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="genderInput" id="femaleRadio" value="female"> <label class="form-check-label" for="femaleRadio"> Female </label> </div> </div> <div class="form-group"> <label for="interestsInput">Interests</label> <div class="form-check"> <input class="form-check-input" type="checkbox" value="music" id="musicCheckbox"> <label class="form-check-label" for="musicCheckbox"> Music </label> </div> <div class="form-check"> <input class="form-check-input" type="checkbox" value="sports" id="sportsCheckbox"> <label class="form-check-label" for="sportsCheckbox"> Sports </label> </div> <div class="form-check"> <input class="form-check-input" type="checkbox" value="movies" id="moviesCheckbox"> <label class="form-check-label" for="moviesCheckbox"> Movies </label> </div> </div> <div class="form-group"> <label for="citySelect">City</label> <select class="form-control" id="citySelect"> <option>New York</option> <option>Los Angeles</option> <option>Chicago</option> <option>Houston</option> <option>Philadelphia</option> </select> </div> <button type="submit" class="btn btn-primary">Submit</button> </form> ``` 这个表单包括五个输入字段:姓名,电子邮件地址,性别(单选框),兴趣爱好(复选框),城市(下拉菜单)。每个输入字段都有一个相应的标签和占位符文本。表单中还有一个提交按钮。这个表单的样式使用了 Bootstrap 的默认样式

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值