HTML & CSS Basics to Pro
- 70Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
<!DOCTYPE html> tells the browser to use a70 questions
- 1The special line_____
<!DOCTYPE html>tells the browser to use aversion of HTML.Hint
This declaration prevents the browser from falling back to an older, less feature-rich version.
Answer
modern
- 2An HTML element consists of an opening tag, a closing tag, and the_____in between.
Hint
Think about what goes between the tags, like text or other elements.
Answer
content
- 3Elements like_____
<img>and<input>are calledelements because they do not require a closing tag.Hint
These are exceptions to the rule that all HTML elements need an opening and closing tag.
Answer
void
- 4An HTML_____modifies how an element behaves, written as
name="value"inside the opening tag.Hint
For example,
hrefdetermines where a link goes, andtargetcontrols how it opens.Answer
attribute
- 5The_____
<a>element creates ato another website.Hint
This element is used to navigate to other pages or resources.
Answer
link
- 6To make a link open in a new tab, set the attribute_____
targetto.Hint
The value starts with an underscore and means a new browsing context.
Answer
_blank
- 7The proper structure of every HTML file includes_____
<!DOCTYPE html>,<html>,<head>, and.Hint
This is where all visible content goes.
Answer
- 8The_____
<title>element is placed inside thesection of an HTML file.Hint
This section is not visible on the page but contains metadata and other non-displayed elements.
Answer
head
- 9To load an external CSS file, use the_____
<link>element withrel="stylesheet"and `` attributes.Hint
This attribute specifies the path to the CSS file.
Answer
href
- 10In a file path, typing the name of a folder followed by a_____means you are going inside that folder.
Hint
This symbol is used to separate directory levels.
Answer
slash
- 11HTML combines multiple spaces and new lines into a single_____, which can make formatting tricky.
Hint
This behavior means extra whitespace in the code is ignored and only one appears on the page.
Answer
space
- 12The_____
<img>element uses the `` attribute to specify which image file to display.Hint
This attribute works like a file path to the image.
Answer
src
- 13An_____
<input>element withtype="text"creates athat users can type into.Hint
This form control allows single-line text input.
Answer
text box
- 14The_____
<span>element is a genericelement that has no default styles.Hint
It is used to apply styles to a specific part of text without affecting the whole line.
Answer
text
- 15HTML entities like_____
·are used to displaycharacters that might otherwise be interpreted as code.Hint
These allow you to include characters like dots, checkmarks, or symbols that have reserved meanings in HTML.
Answer
special
- 16In CSS, the word before the curly braces is called a_____, and it tells the computer which elements to style.
Hint
It can be an element name, a class name (with a dot), or an id (with a hash).
Answer
selector
- 17A CSS rule consists of a property and a_____, separated by a colon.
Hint
This is what you set the property to, like
redforcoloror16pxforfont-size.Answer
value
- 18To target all elements with a specific class in CSS, you write a_____followed by the class name.
Hint
This punctuation mark precedes the class name in the selector.
Answer
dot
- 19The CSS property_____
background-colorchanges theof an element.Hint
This property affects the area behind the content and padding.
Answer
background color
- 20The CSS property_____
colorchanges theof the text inside an element.Hint
This property only affects the text, not the background.
Answer
color
- 21An RGB color value is written as_____
rgb(red, green, blue), where each value ranges from 0 to.Hint
Think about the maximum intensity for each color channel.
Answer
255
- 22A hex color code starts with a_____and is followed by six hexadecimal digits.
Hint
This symbol is always at the beginning of a hex color.
Answer
- 23The CSS property_____
border-radiuswith a value of 50% makes an elementwhen it has equal width and height.Hint
Think about the shape that results from maximum corner rounding.
Answer
round
- 24The pseudo-class_____
:hoverapplies styles when the userover an element.Hint
This action involves moving the mouse pointer over the element.
Answer
hovers
- 25The pseudo-class_____
:activeapplies styles when the element is being.Hint
This state lasts from the moment the mouse button is pressed until it is released.
Answer
clicked
- 26The CSS property_____
opacitycontrols howan element is, with 1 being fully opaque and 0 being fully transparent.Hint
Think about the opposite of opaque.
Answer
transparent
- 27The_____
transitionproperty in CSS makes changes between styles occurover a specified duration.Hint
This property animates property changes instead of instant jumps.
Answer
smoothly
- 28The_____
box-shadowproperty takes four values: horizontal offset, vertical offset, blur, and.Hint
This last value defines the shadow's tint.
Answer
color
- 29Setting_____
pointer-events: noneon an element prevents it from being the target ofevents.Hint
This property disables interactions like clicks and hovers on that element.
Answer
mouse
- 30The_____
white-space: nowrapproperty prevents text fromto the next line.Hint
This forces all text to stay on one line, even if it overflows.
Answer
wrapping
- 31Margin is the space on the_____of an element.
Hint
This space is transparent and separates the element from others.
Answer
outside
- 32Padding is the space on the_____of an element, between the content and the border.
Hint
This spacing is inside the element's border.
Answer
inside
- 33The CSS_____
displayproperty valueblockmakes an element take up the entireof its container.Hint
This causes the element to start on a new line and stretch to fill the container width.
Answer
line
- 34The_____
display: inline-blockvalue allows an element to sit beside others while still respectingand height.Hint
Unlike inline elements, you can set dimensions on inline-block elements.
Answer
width
- 35The property_____
vertical-align: topis used to align elements to theof their container when using inline-block.Hint
This overrides the default baseline alignment.
Answer
top
- 36CSS Grid requires you to set_____
display: gridand define the columns usinggrid-template-columnswith values like1frforspace.Hint
The
frunit stands for fraction of the available space.Answer
remaining
- 37To add space between columns in a grid, use the property `_____`.
Hint
This property specifies the gap between grid columns.
Answer
column-gap
- 38To add space between rows in a grid, use the property `_____`.
Hint
This property specifies the gap between grid rows.
Answer
row-gap
- 39In Flexbox, setting_____
justify-content: space-betweendistributes items evenly with the first item at the start and the last item at the.Hint
This value uses the available space to separate items.
Answer
end
- 40The_____
align-items: centerproperty in Flexbox aligns itemsin the cross axis.Hint
When the flex direction is row, this centers items vertically.
Answer
vertically
- 41Setting_____
flex: 1on a flex item makes it grow to fill thespace in the container.Hint
This property is a shorthand for flex-grow, flex-shrink, and flex-basis.
Answer
remaining
- 42To prevent a flex item from shrinking, set_____
flex-shrinkto.Hint
A value of zero means the item will not shrink below its initial size.
Answer
0
- 43When using_____
flex-direction: column,justify-contentcontrols alignment along theaxis.Hint
The axes swap: the main axis becomes vertical.
Answer
vertical
- 44CSS Grid is more_____than Flexbox because you first define the columns and rows, and items are placed accordingly.
Hint
This means the layout structure is predetermined, and items cannot easily take their sizes with them.
Answer
rigid
- 45An element with_____
position: fixedis positioned relative to thewindow and does not move when scrolling.Hint
It stays in the same place on the screen.
Answer
browser
- 46An element with_____
position: absoluteis positioned relative to its nearest positioned ancestor (any element with a position other than).Hint
The default position value is static; absolute positioning ignores static parents.
Answer
static
- 47Setting_____
position: relativeon an element does not change its layout but allowschildren to be positioned relative to it.Hint
This combination is used to place elements precisely inside another element.
Answer
absolute
- 48The_____
z-indexproperty controls theorder of positioned elements.Hint
Higher values appear on top of lower values.
Answer
stacking
- 49To create a tooltip that appears on hover, use_____
position: relativeon the container and `position:` on the tooltip element.Hint
This allows you to place the tooltip precisely within the container.
Answer
absolute
- 50To make a tooltip appear only when hovering over a button, set its_____
opacityto 0 by default and to 1 on the button'sstate.Hint
Use the pseudo-class that detects mouse hover.
Answer
hover
- 51The shorthand property_____
padding: 10px 20pxsets the top/bottom to 10px and left/right to.Hint
With two values, the first is vertical, the second is horizontal.
Answer
20px
- 52The shorthand property_____
border: 2px solid redsets the width, style, andin one line.Hint
This replaces three separate properties.
Answer
color
- 53CSS properties like_____
colorandfont-familyarefrom parent to child elements.Hint
This means child elements can automatically get these styles without explicitly setting them.
Answer
inherited
- 54A class selector (_____
.classname) has higherthan an element selector (div), so it overrides conflicting styles.Hint
This determines which CSS rule wins when multiple target the same element.
Answer
specificity
- 55Semantic elements like_____
<header>and<nav>work identically to<div>but provide meaning for screen readers and.Hint
This helps with accessibility and SEO.
Answer
search engines
- 56An HTML comment is written as_____
<!--and ends with ``.Hint
This closes the comment, similar to XML syntax.
Answer
-->
- 57A CSS comment starts with_____
/*and ends with.Hint
This is the standard way to write multi-line comments in CSS.
Answer
*/
- 58To load a font from Google Fonts, you copy the_____
<link>code provided by Google and paste it into thesection of your HTML.Hint
This element contains metadata and links to external resources.
Answer
head
- 59A font stack (e.g.,_____
font-family: Roboto, Arial) provides afont in case the first font fails to load.Hint
This ensures the text still displays with a similar font if the primary one is unavailable.
Answer
backup
- 60Font weight values like 400, 500, and 700 correspond to normal, medium, and_____respectively.
Hint
This numeric value is the standard for bold text.
Answer
bold
- 61The_____
<strong>element makes textby default.Hint
This inline element adds emphasis through visual weight.
Answer
bold
- 62The_____
<u>element creates text that is.Hint
This element is often used to indicate a hyperlink or emphasis.
Answer
underlined
- 63Setting_____
text-align: centeron a block element centers itscontent horizontally.Hint
This property affects inline content inside the block.
Answer
text
- 64The_____
line-heightproperty sets the amount of spacelines of text.Hint
This affects vertical spacing within a paragraph.
Answer
between
- 65The_____
text-decorationproperty can add anto text, as used for underlining links.Hint
It also supports values like
overlineandline-through.Answer
underline
- 66Media queries allow you to apply CSS styles based on the_____of the viewport.
Hint
They use conditions like
max-widthto trigger different layouts.Answer
size
- 67A media query with_____
@media (max-width: 600px)applies styles only when the viewport is 600 pixels or.Hint
max-widthmeans the condition is true at that width and below.Answer
less
- 68The Chrome DevTools can be opened by right-clicking on a webpage and selecting_____.
Hint
This option opens a panel showing HTML and CSS.
Answer
Inspect
- 69In Chrome DevTools, the Computed tab shows the final_____values of an element after all CSS rules are applied.
Hint
This includes properties like height, color, and margin, taking into account specificity and inheritance.
Answer
style
- 70The pointer icon in the top-left corner of DevTools lets you_____over elements on the page to select them in the HTML panel.
Hint
Click the icon, then move your mouse over the page to inspect elements.
Answer
hover

Ask anything
We've read this whole study set, so questions about it get the best answers.