form_2

1,input 属性值,接上个。

<style>

        .btn{
            border:1px solid #999;
            outline: none;
            background: linear-gradient(#fff,#aaa);
        }
        .btn:active{
            background: linear-gradient(#aaa,#fff);
        }

    </style>

<form action="https://www.baidu.com/s">
    <input type="text" name="wd" value="请输入用户名">
    <input type="submit" value="百度一下">
    <input type="reset">
    <input type="button" value="自定义按钮" class="btn">
    <input type="file">
    <input type="hidden" name="asoaj" value="asdai">

</form>

2,label   内联元素

               用for属性来扩大input元素的可点击范围

                    方法一:ID        

    <input type="radio" id="b"><label for="a">男</label>   

                    方法二:用label把input包起来

   <label>
    <input type="radio"><span>男</span>

   </label>

*里面不能包两个input。

  3,checked="checked"    属性规定默认被选中的选项(可以简写成checked) 只能用于选择类型的表单元素,(其他元素用了  也无效)

  4,disabled=“disabled”属性规定默认被禁用的表单元素

  代码示例:

<input type="text" checked disabled>

<input type="radio" checked><span>男</span>

<input type="radio" disabled><span>女</span>

猜你喜欢

转载自blog.csdn.net/quxiaojiao_39/article/details/80322356
今日推荐