HTML & CSS Misc. Flashcards
What is an element?
An element is what HTML is composed of. Elements structure a web page and define its content. A tag and the content between two tags is called an HTML element.
What is the body tag?
The body tag is an HTML element, and the content inside this element is what displays on the screen.
What is a child element?
A child element is an element contained inside another element, which is the parent element.
How many types of headings are there in HTML?
6 total (h1 through h6)
What is the div element?
The div element is a container that divides the page into sections. This helps group elements in the HTML together. Also, div stands for division.
What is an attribute?
Attributes are content added to the opening tag of an element. They can be used in different ways like providing information or changing styling.
What are attributes made out of?
The name of the attribute and the value of the attribute.
Which tags do you use to display text in HTML?
Paragraph tag or span tag
When is it best to use a span element vs. div element?
Use span when you want to target a specific piece of content that is inline.
Use div when you want to divide your content into blocks.
Do the image (img) and break (br) tags require end tags?
No
What attribute is required in an image tag?
source (src) attribute
What should you always include in image tags to help with assistive technologies?
An alt attribute that provides a description of the image.
Does the video tag require an end tag?
Yes
How do you link to other web pages in HTML?
By using an anchor element <a> which requires an href attribute. The element requires an end tag and content between the tags.</a>
What attribute can you use to open a link in a new window?
target attribute
How do you add comments to HTML?
Less than sign, exclamation point, dash, dash, your comment, dash, dash, and then greater than sign.
What are some ways you can help with accessibility on the web?
- Ensure semantic HTML.
- Set the language attribute on the open html tag. This help with screen readers.
- Style with high-contrast and accessible fonts.
What does the display property determine?
How an element’s box is rendered in the browser. Every HTML element is a box by default.
What are the three display properties?
Inline, block, and inline-block
How do you remove white-space between inline-block elements that are displaying side-by-side?
Add font-size: 0 to the parent element.
What properties should you use when you want to horizontally center block-level content relative to a parent element?
display: block;
margin-left: auto;
margin-right: auto;
What properties should you use when you want to horizontally center inline elements within a block element?
display: inline-block;
text-align: center;
What does “a11y” stand for?
Web accessibility
What is the position property?
The position property is about the flow of elements on HTML.