首页 > Web开发 > 详细

HTML里不为人知的秘密(02)之常见元素属性使用

时间:2020-07-04 17:21:15      阅读:53      评论:0      收藏:0      [点我收藏+]

HTML里不为人知的秘密(02)之常见元素属性使用

01) 表单元素分组

  fieldset  legend 表单元素分组

技术分享图片
<form>
    <fieldset style="width: 30px;">
        <legend>个人信息</legend>
        姓名:<input type="text" /> <br>
        年龄:<input type="text" />
    </fieldset>
</form>
View Code

技术分享图片

02) label 和 radio 配合

    label 和 input 中  radio 配合使用,让文字可以点击

技术分享图片
<div>
    <input type="radio" id="foo" name="drone" value="foo"
           checked>
    <label for="foo">foo</label>
</div>

<div>
    <input type="radio" id="bar" name="drone" value="bar">
    <label for="bar">bar</label>
</div>

<div>
    <input type="radio" id="hello" name="drone" value="hello">
    <label for="hello">hello</label>
</div>
View Code

技术分享图片

03) border 和 outline 区别

轮廓不占据空间,绘制于元素内容周围。
根据规范,轮廓通常是矩形,但也可以是非矩形的

outline属性

04) 

HTML里不为人知的秘密(02)之常见元素属性使用

原文:https://www.cnblogs.com/dafei4/p/13235419.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!