html basics Flashcards
what are and when should elements be used?
represents an independent article in a web page. It should only wrap content that can be plucked out of your page and distributed in a completely different context
what are and when should elements be used?
keeps our document outline the exact same while lending it some extra semantic structure.
like an , except it doesn’t need to make sense outside the context of the document. Though heading elements split the document into sections sometimes we need wrappers around the content.
what is a side effect of using
By adding those elements, we’re telling the document outline that it should be defined by the nesting structure of the elements instead of the heading levels. This basically means that each can have its own set of <h1> through <h6> headings that are independent of the rest of the page.
BUT due to screen readers and such it is better to use heading levels dispite using sections</h6></h1>
what should sections contain?
at least one heading element, otherwise it will add an untitled section to you document
lets you mark up the various navigation sections of your website. This goes for the main site navigation, links to related pages in a sidebar, tables of content, and pretty much any group of links.
denotes introductory content for a section, article, or entire web page.
Headers are only associated with the nearest sectioning element. This means that you can use multiple elements to add introductory content to different parts of a document
like headers, but come at the bottom. They are associated with the nearest section element
for tangentially related content
appropriate for highlighting definitions, stats, sidebars, advertisements, or quotations
represents either a time of day or a calendar date. Providing a machine-readable date makes it possible for browsers to automatically link it to users’ calendars and helps search engines
<address></address>
It defines contact information for the author of the article or web page in question. <address> should not be used for arbitrary physical addresses.</address>
represents a self-contained “figure”, like a diagram, illustration, or even a code snippet
what is the difference between and alt=””
alt should serve as a text replacement for the image, while is a supporting description displayed with either the image or its text-based equivalent.
how do you define a root-relative link?
they start with a forward slash ‘/search’
when should we use png?
use for anything that’s not a photo or animated
when should we use gifs?
when we need animation