HTML5 Flashcards
Explain HTML
Hypertext Markup Language
defines the structure and layout of content on web pages
uses a system of elements and tags
HTML vs XHTML
XHTML (Extensible Hypertext Markup Language) is a stricter, more XML-compliant version of HTML.
It requires well-formed and properly nested code, and tag names must be in lowercase.
Explain DOCTYPE
placed at the beginning of an HTML doc
specifies the HTML version being used
helps browsers render web pages correctly
Explain some new features of HTML5
*new semantic elements - header, nav, article
* new form elements
*native audio/video support
* canvas for drawing graphics
*improved offline support
<div> vs <span>
</span></div>
div
*block element used for grouping and structuring content
span
* inline element used for styling or applying scripts to a specific portion of text
Explain <meta></meta>
placed in the <head> section, it provides metadata about an HTML doc
*character set
*viewport settings
*description
Difference between <ol>, <ul>, and <dl>
*<ol> is used for ordered (numbered) lists.
*<ul> is used for unordered (bullet-point) lists.
*<dl> is used for definition lists, typically consisting of terms and their definitions.
Explain <a></a>
anchor tag used to create hyperlinks to:
* another webpage
*a file
*an email address
*any other URL
How do you open a link in a new tab or window?
Use the target=’_blank’ attribute within the <a> tag</a>
How do you create a link that starts a new email?
Use the href=’mailto:<address@email.com’> attribute in the <a> tag</a>
<strong> vs <em></em></strong>
<strong> = bold
<em> = italicized</em></strong>
Explain <iframe>
*iniline frame
*used to embed another HTML doc within the current doc
*typically used with videos, maps, or external content
Explain <form>
creates an HTML form that collects user input
<input></input> vs <input></input>
<input></input>
used for regular text input
<input></input>
used for input fields where the text is obscured (e.g., for passwords)
Purpose of <label> element in relation to <form></label>
Associates a text label with a form control
*improves accessibility
*allows users to click the label to focus on or activate the associated control