HTML/CSS Flashcards
What is HTML
Hyper Text Markup Language. It provides a structure and content to a webpage
What is the HTML5 doctype declaration?
!DOCTYPE
List some tags. What is it used for?
div - block element used to hold other elements or text
headings - h1-h6 used to create headings of varying sizes
p - used to create plain text
img - used to insert an image into HTML
a - Anchor - used to create a link
span - used inside a container and is used to mark up a part of the doc
What are the required tags for an HTML document?
HTML
HEAD
TITLE
BODY
What is the tag for an ordered list? unordered list? Change bullet styling?
ol - ordered list, numbered list
ul - unordered list. Use the property using css or html. list-style-type
Do all tags come in a pair? List a self-closing tag.
Not all tags come in pairs, some are closed in the same tag that calls them
Some Include
col - a column in a table
br - create a line break
hr - creates a horizontal line
img - used to define an image
link - mostly used to add external stylesheets in the head
source - used to give multiple media resources for audio, video, and pictures
What’s the difference between an element and an attribute? List some global attributes.
HTML element holds the content. HTML attributes are used to describe the characteristics of an HTML element in detail.
What is the syntax for a comment in HTML?
Opening Angle Bracket
Exclamation Point
dash dash
What tags would you use to create a table? A navbar? What about a form?
table tag - followed by tr for rows, th for data heading, and td for data
nav tag - used with a tags to create navigation links
form tag - used with inputs to pass user-data
What’s the difference between a class and id?
An ID is only used to identify one single element in our HTML. A class can be used to identify more than one HTML element.
How would you include CSS into an HTML document? What about JS?
script for js and style for css
Both can be implemented from a specific js or css file by adding them in the head
What is a semantic tag? What about formatting tags/elements?
Semantic HTML tags provide information about the contents of those tags that goes beyond just how they look on a page.
Formatting tags are used to make text bold, italicized, or underlined.
Non-Semantic : div, span
Semantic: article, footer, header, main, nav, summary
Formatting: b, i, strong, mark
What’s the difference between a block and an inline element?
Inline elements occupy only sufficient width,dont start new lines, and don’t have top/bottom margins.
Block elements occupy full width of page, always start in a line, have top and bottom margins
What is CSS? what are the different ways of styling an html file?
Cascading Style sheets. It can be added in 3 ways: inline-by using the style attribute in HTML elements, Internal-by using a element in the section, and External-by using an external CSS file.
Which way has highest priority when styles cascade: inline, internal, and external stylesheets. Which is best practice? Why?
Inline has the highest priority, any styles that are defined in the internal and external style sheets are overridden by Inline styles.
Inline mixes content and presentation, so it is best to use it sparingly
Internal should only be used when a specific document has a unique style
external is the best practice as it separates content and presentation and can be used for multiple documents