Pure.CSS - 表单
Pure.CSS 具有非常漂亮且响应灵敏的 CSS,用于表单设计。使用以下 CSS -
先生。 | 类名和描述 |
---|---|
1 | 纯形式 代表紧凑的内联形式。 |
2 | 纯形式堆叠 表示一个堆叠表单,其输入元素位于标签下方。与纯形式一起使用。 |
3 | 纯形式对齐 表示输入元素位于标签下方的对齐表单。与纯形式一起使用。 |
4 | 纯输入舍入 显示带有圆角的表单控件 |
5 | 纯按钮 美化按钮。 |
6 | 纯复选框 美化复选框。 |
7 | 纯无线电 美化收音机。 |
例子
purecss_forms.htm
<html> <head> <title>The PURE.CSS Forms</title> <meta name = "viewport" content = "width = device-width, initial-scale = 1"> <link rel = "stylesheet" href = "https://yui.yahooapis.com/pure/0.6.0/pure-min.css"> </head> <body> <form class = "pure-form pure-form-aligned"> <fieldset> <div class = "pure-control-group"> <label for = "name">Username</label> <input id = "name" type = "text" placeholder = "Username" required> </div> <div class = "pure-control-group"> <label for = "email">Email</label> <input id = "email" type = "text" placeholder = "Email Address" required> </div> <div class = "pure-control-group"> <label for = "comments">Comments</label> <input id = "comments" type="text" placeholder = "Comments"> </div> <div class = "pure-controls"> <label for = "married" class = "pure-checkbox"> <input id = "married" type = "checkbox" checked = "checked"> Married </label> <br> <label for = "single" class = "pure-checkbox"> <input id = "single" type = "checkbox"> Single </label> <br> <label for = "dontknow" class = "pure-checkbox"> <input id = "dontknow" type = "checkbox" disabled> Don't know (Disabled) </label> <br> <br> </div> <div class = "pure-controls"> <label for = "male" class = "pure-radio"> <input id = "male" type = "radio" name = "gender" value = "male" checked> Male </label> <br> <label for = "female" class= "pure-radio"> <input id = "female" type = "radio" name = "gender" value = "female"> Female </label> <br> <label for = "dontknow1" class = "pure-radio"> <input id = "dontknow1" type = "radio" name = "gender" value = "female" disabled> Don't know (Disabled) </label> <button type = "submit" class = "pure-button pure-button-primary">Submit</button> </div> </fieldset> </form> </body> </html>
结果
验证结果。