Week 5 Flashcards
What is HTML?
HTML stands for Hypertext Markup Language and consists of various tags to describe the content of a document - utilized as the basis for all web pages, along with CSS and JavaScript
What is the structure of an HTML document? List some tags. What is used for? ?
Start with the doctype declaration, then , then and . The head contains the metadata for the page, while the body contains the content that is rendered to the screen.
Other tags: div, span, p, ul, ol, li, strong, em, table
What is a doctype?
First tag in the document - defines what type of file it is - whether html 4 or 5, etc
What is the tag for an ordered list? Unordered list?
ordered list: ol, unordered list: ul. Both use li - list items
What are some HTML5 tags? Why were HTML5 tags introduced?
HTML5 introduced semantic tags to more accurately reflect the content of the tags. Examples: <strong> instead of <b>, <em> instead of <i>, , , , , , and instead of reusing <div> tags everywhere</div></i></em></b></strong>
Do all tags come in a pair? What are the other things inside tags called? list some.
No - tags either have a closing tag or are self-closing (). Attributes are contained within tags - examples: id, class, style, height, width, etc
What is the syntax for a comment in HTML?
What are some tags you would use in a form?
, , , , , ,
What is CSS?
CSS stands for Cascading Style Sheets - it is a language for styling HTML documents by specifying certain rules for layout and display in key/value pairs.
what are the different ways of styling an HTML file? Which is best? why?
(1) inline - in the style attribute
(2) internal stylesheet - in the tag in the
(3) external stylesheet - using external .css file, use in the
External stylesheet is best practice due to separation of concerns, reusability, modularity
Describe the CSS box model.
The box model consists of margin (outermost box), then border, then padding, then content (innermost). All box sizes / formatting can be styled with CSS
Which way has highest priority when styles cascade: inline, internal, and external.
Inline has highest priority, then internal/external depending on order. Cascading rules are determined by (1) importance (!important flag), (2) specificity of selector (inline has no selector, highest specificity), then (3) source order.
Syntax for styling an element? What is a class and how to style them? What is an id? how to style? difference?
div { property: value; } .class { property: value; } #id { property: value; }
What if I want to select child elements, What syntax is that?
use direct descendant selector (>) or space for any level nested element
Can I select multiple elements at once? How?
yes, with a comma