HTML Boilerplate with facebook meta-tags, twitter meta-tags, Bootstrapp (CSS CDN, JS and JS dependencies jQuery & Popper.js) and fontawesome
tables
forms
A form is defined by a <form> tag. Inside you define :
An action : where to send the form data when submited
A method : the HTTP request type (GET, POST, PUT, PATCH, DELETE)
<input> tags allows to create fields where visitors can type information. Input tags must have different attributes:
name : that is how you will identify it when the form is send
value : the value of the field & the placeholder value before the user type it (will be paired with the name).
type : determine how it will render :
text : normal text field
password : field where what you type is hidden
number : restrict to number. You can add attributes:
step=1 : will create arrows inside the input and allows the user to increase/decrease numbers 1 by 1
range : will create a slider. You can add attributes:
min
max
step
checkbox don't forget to put a value! (it will be invisible but this is what will be send to the form). And then to associate it to a label (so the user knows what this checkbox correspond to)
radio : to group radio together they must have the same name (and thus you can only select one)
text and list=id = will pair the input to a datalist with the same id
submit : the "value" will be the displayed text. When clicked, it will trigger the form action
label tags are paired with input and serve as their "display name". You pair label with an input thanks to the attribute for:
The input must have an id, and the label must have the same for
Important when using checkbox or radio button. Because when you click on the label it will check the box
<select> tag allows you to create dropdown lists. Inside the select tags you need <options> tags each with a value with your different options:
The value of <option> is the text that will be send to the form
The text between the opening and closing <options> tag is the displayed text
<datalist> tag also create a dropdown but inside a text field, so that users can type into it to easily find options. Inside the datalist you put <options> tags. The <input> tag where the <datalist> is must have a list attribute with the value of the datalist id
<textarea> tags are used to create a bigger text field. If you want a default text you need to include it between the opening and closing textarea tags. This field can take arguments: