HTML Flashcards
What is a href?
href is a reference through URI, URL to reference some other document.
What is usually put in element?
- title for the page
- allows to provide metadata about the document for instance viewport and how it can render
- provides scripts that make pages more interactive.
<style>
- <link> <base> - base address with which all our links to other documents will be based on.</style>
Placing tag in the <head> element vs after <body>
It is a best practice to put JavaScript tags just before the closing </body> tag rather than in the <head> section of your HTML.
When you place your JavaScript links at the bottom of your HTML body, it gives the HTML time to load before any of the JavaScript loads, which can prevent errors, and speed up website response time.
How do you instruct a browser to deal with text breaking and whitespace.
<pre></pre> - tells the browser that this content has been preformated. <br> - add a line break <hr> - horizontal line - non breaking space < > - symbols < >.
How do you reference texts (for example citation or
<sup></sup> - <cite></cite> <abbr></abbr> <code></code> <samp></samp> <blockquote></blockquote>
What are the <div> basic tags replacements that were introduced in HTML5</div>
- nav bar. Usually elements inside of are an unordered list with anchors.
What are basic type of lists?
Unordered List,
<ul>
<li>2 T Wired Brain Coffee Hot Cocoa Mix</li>
<li>8 0z Milk</li>
<li>Marhsmallows (optional)</li>
</ul>
Ordered List,
<ol>
<li>Scoop Hot Cocoa Mix into a mug</li>
<li>Heat milk on thestove or in the microwav oto just below a boil</li>
</ol>
Definition lists:
<dl>
<dt>Cocoa</dt>
<dd>Cocoa is the powdered substance left after processing cacao beans</dd>
<dt>Chocolate</dt> <dd>Chocolate is basically bla bla </dd> </dl>
What are anchors and links?
Link is just another HTML element, with <a> tag (anchor) we indentify that we want to create a source or the target.</a>
There are three basic types:
Source anchor - can redirect us to a webpage, when we click on a link.
Named anchor - redirects us to a page element
Implicit anchor - redirects us to a page element using id of the element, such as <div></div></a>
How do you link your document through a relative link
<a></a>
You can also Reference anchor in another document:
<a>Location 2 </a>
redirects the browser to the top of the page
What are the basic attributes you can add to links?
target - provide context to the browser about where you want this content to be opened. target=”_blank” will open in a new window
rel=”noreferrer noopener” security related measure, when we create to that site, we don’t want that site to have access to the window that opened it
What is the role of HTML element
is for DATA.
It is not used for formatting your documents. Table of contents is not data. Displaying pictures shuld be done in grids.
What are the components that set up the structure of a table?
Caption - tells user what the table shows them (espacially assistant screen readers)
Header - top row in the table that will provide information to the users that helps them understand the data below
Body -
Footer - for aggregate values, sums, averages.
HTML <img></img> attributes
src=”wired-brain-coffee-logo.png” - where can the image file be found
alt=”wiredbraincoffe.com” - text to display or read in place of the image
height/width - control display sizing.
When and how do you provide alternate image sizes.
Alternate image sizes are needed because it needs to render differently for different devices.
srcset=”logo.png 500w, logo-250.png 250w”
sizes=”(max-width: 30em) 25vw, 33vw”
sizes tell the browser, to be relative to the viewport - allows the browser to make smart decision which image it should use.
What is a <span> element?</span>
Span element is inline container for phrasing content. It is usually used to group elements for styling purposes.
For example used for pop up text and instead of obsolete html tags s.a<strong>, <b>, <i> that we do not have control of. With <span>, we can define everything through CSS.</span></i></b></strong>