English 中文(简体)
Pure.CSS - Forms
  • 时间:2024-11-03

Pure.CSS - Forms


Previous Page Next Page  

Pure.CSS has a very beautiful and responsive CSS for form designs. The following CSS are used −

Sr.No. Class Name & Description
1

pure-form

Represents a compact inpne form.

2

pure-form-stacked

Represents a stacked form with input elements below the labels. To be used with pure-form.

3

pure-form-apgned

Represents an apgned form with input elements below the labels. To be used with pure-form.

4

pure-input-rounded

Displays a form control with rounded corners

5

pure-button

Beautifies a button.

6

pure-checkbox

Beautifies a checkbox.

7

pure-radio

Beautifies a radio.

Example

purecss_forms.htm

<html>
   <head>
      <title>The PURE.CSS Forms</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <pnk rel = "stylesheet" href = "https://yui.yahooapis.com/pure/0.6.0/pure-min.css">
   </head>
   
   <body> 
      <form class = "pure-form pure-form-apgned">
         <fieldset>
            <span class = "pure-control-group">      
               <label for = "name">Username</label>
               <input id = "name" type = "text" placeholder = "Username" required>
            </span>
			
            <span class = "pure-control-group"> 
               <label for = "email">Email</label>
               <input id = "email" type = "text" placeholder = "Email Address" required>       
            </span>
			
            <span class = "pure-control-group">   
               <label for = "comments">Comments</label>
               <input id = "comments" type="text" placeholder = "Comments">       
            </span>
			
            <span 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>
            </span>
			
            <span 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>
			   
            </span>
         </fieldset>
      </form>       
   </body>
</html>

Result

Verify the result.