html Flashcards
what does the “id” attribute do
specifies different content, helpful when you use an element more than once
<em></em>
emphasises text
<strong></strong>
makes text bold
<br></br></br>
line break
<ul></ul>
creates an unordered list
<li></li>
adds individual items to the unordered list
whats an unordered list
a list that doesnt have numbers like 1. , 2.
<ol></ol>
ordered list
alt attribute
- ## If an image fails to load on a web page, a user can mouse over the area originally intended for the image and read a brief description of the image
<video></video>
adds a video url
<a></a>
anchor element which connects 2 links
how to open a different link in a NEW WINDOW
<a href = (link) target=”_blank”></a>
how to open a different link by clicking on an image
<a href=”(newlink)” target=”_blank””><img></img></a>
how to create a link that takes you to a different part of the same page
href = “#(id of the part of the page)”
how to make a comment
start with <!-- end with -->
<table></table>
creates a table
- how to add rows in a table
- how to add data in a table
create the table then add <tr></tr> below the table element
under the table rows, add <td></td>
how to add titles to rows and columns
<th></th>
, you then add a scope attricute and specify if the title is assigned to a “row” or a “col”
colspan attribute
The attribute accepts an integer (greater than or equal to 1) to denote the number of columns it spans across.
rowspan attribute
span multiple rows
<tbody></tbody>
Long tables can be sectioned off using the table body element: <tbody>
how to section off a tables columns heading
<thead></thead>
how to section off the bottom part of a long table
<tfoot>
</tfoot>
<th>
</th>
represents the header of a table column or row
order of table elements when making a table
<table>
<thead>
<tbody>
<tr>
<th></th>
</tr>
</tbody>
</thead>
</table>
<form></form>
creates a form
action attribute
determines where the information in the form is sent to
method attribute
assigns a HTTP verb that is included in the HTTP request, eg method = “POST
how to add an input for a form
<input></input>
type attribute
determines how it renders on the web page and what kind of data it can accept, eg type =”text”
value attribute
adds text inside the form
name attribute
The name attribute assigns a unique identifier to the <input></input> element, which is used when the form data is submitted
<label></label>
adds writing on top of the form, need to add a “for” attribute. for attribute has to match the id attribute
type=””
- text
- password
- number
- range (can set min and max)
- checkbox
- radio
step attribute
creates arrows inside the input field to increase or decrease by the value of the step attribute
how to do choices in a list
<form></form>
<label></label>
select></select>
<option></option>
choice layout
<section></
<label></
<input></input>
</section>
</label></section>
how to do a datalist(no scrolling)
<form>
<label</label>
<input></input>
<datalist>
<option></option>
</datalist>
</form>
<textarea></textarea>
used to create a bigger text field for users to write more text. We can add the attributes rows and cols to determine the amount of rows and columns for the <textarea></textarea>