HTML & CSS Flashcards
Block vs Inline Elements
HTML tags fall into one of these two categories. Block elements fill the entire width of the page. Inline elements sit next to one another and always go inside block elements.
!doctype html (in open & closed brackets)
First line of HTML document.. Tells computer you are looking at a Hyper Text Markup Language page. MUST HAVE. Don’t forget to close at the very end of doc.
meta charset=”utf-8” (in open & closed brackets)
Tells the computer what character set you are using. Goes inside the Head tag.
title (in open & closed brackets)
Site’s name. Goes inside Head tag. MUST HAVE.
script (in open & closed brackets)
Links to external JavaScript files vis the src attribute.
link (in open & closed brackets)
Links to external stylesheets via the href attribute.
head (in open & closed brackets)
The area where your meta tags go. Includes charset & title. Content not visible to website viewer. MUST HAVE.
body (in open & closed brackets)
Content for your website. Everything visible to website viewer. MUST HAVE.
div (in open & closed brackets)
Use divs for different site sections, sidebars, footers, etc. All about organization. Can use divs within divs as nested elements and should be indented within your code. STRUCTURAL TAG.
header (in open & closed brackets)
Site headers and headers for sections/articles. STRUCTURAL TAG.
nav (in open & closed brackets)
Site navigation. STRUCTURAL TAG.
section (in open & closed brackets)
Denote major sections of website. NOT allowed to put sections inside one another. STRUCTURAL TAG.
article (in open & closed brackets)
Use for individual pieces of content on a site such as news articles, blog posts, or comments. STRUCTURAL TAG.
aside (in open & closed brackets)
Use to add secondary type of content such as sidebars. STRUCTURAL TAG.
footer (in open & closed brackets)
These tags are used for footers for your site or major pieces of content like articles or sections. STRUCTURAL TAG.
Structural Tags
Header, Nav, Main, Aside, Section, Article, Footer - can all be used to organize elements in place of Div tags.
Inline Tags
Bold, Italic, Line Breaks, Links to external sites using the href attribute.
img (self closing bracket)
Adds images. Be sure to put image link in src attribute and add a name in the alt attribute. SELF CLOSING.
<img></img>
a (in open & closed brackets)
Adds links to external sites via the href attribute. INLINE ELE TAG. <a>…</a>
span (in open & closed brackets)
Span tags allow you to add style to portions of inline text. You will add style with CSS. INLINE TAG. Example: <p>This text is plain <span>and this will be fancy!</span></p>