HTML5 使用CSS 格式化fieldset容器的Legend
下面的例子展示了,你如使用CSS来改变HTML5的Fieldset标签的legend。
<!DOCTYPE html> <html> <head> <style type="text/css"> label { color: #F00; } legend { color: #F00; font-family: "Comic Sans MS"; font-weight: bold; text-shadow: #999 2px 2px 1px; text-transform: uppercase; } </style> </head> <body> <fieldset> <legend>Comments form</legend> <table> <tr> <th><label for="usrnm">Username:</label></th> <td><input id="usrnm" type="email" name="username" placeholder="[email protected]" /></td> </tr> <tr> <th><label for="psswd">Password:</label></th> <td><input id="psswd" type="password" name="password" placeholder="Top secret password" /></td> </tr> <tr> <th><label for="cmmnts">Comments:</label></th> <td><textarea id="cmmnts" cols="30" rows="5" placeholder="Comments"></textarea></td> </tr> <tr> <th><label for="sub">Subscribe:</label></th> <td><input id="sub" type="checkbox" value="1" /></td> </tr> <tr> <td> </td> <td><input id="submitBtn" type="submit" value="Submit" /></td> </tr> </table> </fieldset> </body> </html>
源码下载:
相关推荐
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18