Basic HTML and HTML5 Flashcards
Elements for headings:
< h1 > - < h6 >
Paragraph element:
<p></p>
How to leave comments in HTML:
< ! - - here - - >
How to add images in html:
< img src = “ “>
Paragraph element:
<p></p>
What is an alt attribute?
An alt attribute is used for screen readers to improve accessibility and is displayed if the image fails to load.
Alt attribute example:
< img src = “picture.jpg” alt = “guy doing stuff” >
How to link external pages with anchor elements:
< a href= “website.com” >this links to my website < /a >
How to link to internal sections of a page with Anchor elements:
Create an < a href= “id attribute” >jump to bottom< /a > and add that id attribute to an element on the bottom of the page.
Which anchor tag attribute opens a new tab?
< a target=”_blank” href =……. < /a >
How to nest an anchor element within a paragraph:
< p >
Hello here’s a link to < a target = “_blank” href = “brains cape.com” > brainscape.com < /a >
< /p >
(Only the brainscape is highlighted)
How do you make Dead links?
replacing a href attribute value with a #. (ex: a href: “ # “
How to turn an image into a link?
Nest the image within an A element.
How to create bulleted unordered list:
Use the < ul > element and follow it up with < li > elements for every entry in the list.
How to create an ordered list:
Use the < ol > element and follow it up with < li > elements for every entry in the list.
How to create a text field:
< input type= “text” >
How to add a placeholder to a text field:
< input type= “text” placeholder: “type here” >
How to create a form element:
< form action= “/url-where-you-want-to-submit-form-data” >< /form >
How to add a submit button to a form:
Nest this within a form element < button type =”submit” >Submit< /button >
How to make a text field required:
Add the word required after input type. (ex: < input type=”text” required >)
How to create a set of radio buttons
< label for=”option 1” >
< input id=”option 1” type=”radio” name=”1-2” >Indoor
< /label >
How to create a set of checkboxes:
< label for=”option 1” >< input id=”option_1” value=”option 1” type=”checkbox” name=”options”> Option 1< /label >
How to use the value attribute with Radio Buttons and Checkboxes
< label for=”option 1” >
< input id=”option 1” type=”radio” name=”1-2” >Indoor
< /label >
How to check Radio Buttons by default
< input type=”radio” name=”test-name” checked >