1. Home
  2. Explore
  3. Computer Science
  4. HTML & CSS Basics to Pro

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

HTML & CSS Basics to Pro

  • 70Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: HTML Fundamentals
The special line <!DOCTYPE html> tells the browser to use a
version of HTML.

70 questions

  1. 1
    The special line <!DOCTYPE html> tells the browser to use a
    _____
    version of HTML.
    Hint

    This declaration prevents the browser from falling back to an older, less feature-rich version.

    Answer

    modern

  2. 2
    An 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

  3. 3
    Elements like <img> and <input> are called
    _____
    elements 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

  4. 4
    An HTML
    _____
    modifies how an element behaves, written as name="value" inside the opening tag.
    Hint

    For example, href determines where a link goes, and target controls how it opens.

    Answer

    attribute

  5. 5
    The <a> element creates a
    _____
    to another website.
    Hint

    This element is used to navigate to other pages or resources.

    Answer

    link

  6. 6
    To make a link open in a new tab, set the attribute target to
    _____
    .
    Hint

    The value starts with an underscore and means a new browsing context.

    Answer

    _blank

  7. 7
    The proper structure of every HTML file includes <!DOCTYPE html>, <html>, <head>, and
    _____
    .
    Hint

    This is where all visible content goes.

    Answer
  8. 8
    The <title> element is placed inside the
    _____
    section of an HTML file.
    Hint

    This section is not visible on the page but contains metadata and other non-displayed elements.

    Answer

    head

  9. 9
    To load an external CSS file, use the <link> element with rel="stylesheet" and `
    _____
    ` attributes.
    Hint

    This attribute specifies the path to the CSS file.

    Answer

    href

  10. 10
    In 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

  11. 11
    HTML 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

  12. 12
    The <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

  13. 13
    An <input> element with type="text" creates a
    _____
    that users can type into.
    Hint

    This form control allows single-line text input.

    Answer

    text box

  14. 14
    The <span> element is a generic
    _____
    element 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

  15. 15
    HTML entities like &middot; are used to display
    _____
    characters 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

  16. 16
    In 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

  17. 17
    A CSS rule consists of a property and a
    _____
    , separated by a colon.
    Hint

    This is what you set the property to, like red for color or 16px for font-size.

    Answer

    value

  18. 18
    To 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

  19. 19
    The CSS property background-color changes the
    _____
    of an element.
    Hint

    This property affects the area behind the content and padding.

    Answer

    background color

  20. 20
    The CSS property color changes the
    _____
    of the text inside an element.
    Hint

    This property only affects the text, not the background.

    Answer

    color

  21. 21
    An 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

  22. 22
    A 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

  23. 23
    The CSS property border-radius with a value of 50% makes an element
    _____
    when it has equal width and height.
    Hint

    Think about the shape that results from maximum corner rounding.

    Answer

    round

  24. 24
    The pseudo-class :hover applies styles when the user
    _____
    over an element.
    Hint

    This action involves moving the mouse pointer over the element.

    Answer

    hovers

  25. 25
    The pseudo-class :active applies styles when the element is being
    _____
    .
    Hint

    This state lasts from the moment the mouse button is pressed until it is released.

    Answer

    clicked

  26. 26
    The CSS property opacity controls how
    _____
    an element is, with 1 being fully opaque and 0 being fully transparent.
    Hint

    Think about the opposite of opaque.

    Answer

    transparent

  27. 27
    The transition property in CSS makes changes between styles occur
    _____
    over a specified duration.
    Hint

    This property animates property changes instead of instant jumps.

    Answer

    smoothly

  28. 28
    The box-shadow property takes four values: horizontal offset, vertical offset, blur, and
    _____
    .
    Hint

    This last value defines the shadow's tint.

    Answer

    color

  29. 29
    Setting pointer-events: none on an element prevents it from being the target of
    _____
    events.
    Hint

    This property disables interactions like clicks and hovers on that element.

    Answer

    mouse

  30. 30
    The white-space: nowrap property prevents text from
    _____
    to the next line.
    Hint

    This forces all text to stay on one line, even if it overflows.

    Answer

    wrapping

  31. 31
    Margin is the space on the
    _____
    of an element.
    Hint

    This space is transparent and separates the element from others.

    Answer

    outside

  32. 32
    Padding 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

  33. 33
    The CSS display property value block makes an element take up the entire
    _____
    of its container.
    Hint

    This causes the element to start on a new line and stretch to fill the container width.

    Answer

    line

  34. 34
    The display: inline-block value allows an element to sit beside others while still respecting
    _____
    and height.
    Hint

    Unlike inline elements, you can set dimensions on inline-block elements.

    Answer

    width

  35. 35
    The property vertical-align: top is used to align elements to the
    _____
    of their container when using inline-block.
    Hint

    This overrides the default baseline alignment.

    Answer

    top

  36. 36
    CSS Grid requires you to set display: grid and define the columns using grid-template-columns with values like 1fr for
    _____
    space.
    Hint

    The fr unit stands for fraction of the available space.

    Answer

    remaining

  37. 37
    To add space between columns in a grid, use the property `
    _____
    `.
    Hint

    This property specifies the gap between grid columns.

    Answer

    column-gap

  38. 38
    To add space between rows in a grid, use the property `
    _____
    `.
    Hint

    This property specifies the gap between grid rows.

    Answer

    row-gap

  39. 39
    In Flexbox, setting justify-content: space-between distributes 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

  40. 40
    The align-items: center property in Flexbox aligns items
    _____
    in the cross axis.
    Hint

    When the flex direction is row, this centers items vertically.

    Answer

    vertically

  41. 41
    Setting flex: 1 on a flex item makes it grow to fill the
    _____
    space in the container.
    Hint

    This property is a shorthand for flex-grow, flex-shrink, and flex-basis.

    Answer

    remaining

  42. 42
    To prevent a flex item from shrinking, set flex-shrink to
    _____
    .
    Hint

    A value of zero means the item will not shrink below its initial size.

    Answer

    0

  43. 43
    When using flex-direction: column, justify-content controls alignment along the
    _____
    axis.
    Hint

    The axes swap: the main axis becomes vertical.

    Answer

    vertical

  44. 44
    CSS 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

  45. 45
    An element with position: fixed is positioned relative to the
    _____
    window and does not move when scrolling.
    Hint

    It stays in the same place on the screen.

    Answer

    browser

  46. 46
    An element with position: absolute is 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

  47. 47
    Setting position: relative on an element does not change its layout but allows
    _____
    children to be positioned relative to it.
    Hint

    This combination is used to place elements precisely inside another element.

    Answer

    absolute

  48. 48
    The z-index property controls the
    _____
    order of positioned elements.
    Hint

    Higher values appear on top of lower values.

    Answer

    stacking

  49. 49
    To create a tooltip that appears on hover, use position: relative on the container and `position:
    _____
    ` on the tooltip element.
    Hint

    This allows you to place the tooltip precisely within the container.

    Answer

    absolute

  50. 50
    To make a tooltip appear only when hovering over a button, set its opacity to 0 by default and to 1 on the button's
    _____
    state.
    Hint

    Use the pseudo-class that detects mouse hover.

    Answer

    hover

  51. 51
    The shorthand property padding: 10px 20px sets the top/bottom to 10px and left/right to
    _____
    .
    Hint

    With two values, the first is vertical, the second is horizontal.

    Answer

    20px

  52. 52
    The shorthand property border: 2px solid red sets the width, style, and
    _____
    in one line.
    Hint

    This replaces three separate properties.

    Answer

    color

  53. 53
    CSS properties like color and font-family are
    _____
    from parent to child elements.
    Hint

    This means child elements can automatically get these styles without explicitly setting them.

    Answer

    inherited

  54. 54
    A class selector (.classname) has higher
    _____
    than an element selector (div), so it overrides conflicting styles.
    Hint

    This determines which CSS rule wins when multiple target the same element.

    Answer

    specificity

  55. 55
    Semantic 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

  56. 56
    An HTML comment is written as <!-- and ends with `
    _____
    `.
    Hint

    This closes the comment, similar to XML syntax.

    Answer

    -->

  57. 57
    A CSS comment starts with /* and ends with
    _____
    .
    Hint

    This is the standard way to write multi-line comments in CSS.

    Answer

    */

  58. 58
    To load a font from Google Fonts, you copy the <link> code provided by Google and paste it into the
    _____
    section of your HTML.
    Hint

    This element contains metadata and links to external resources.

    Answer

    head

  59. 59
    A font stack (e.g., font-family: Roboto, Arial) provides a
    _____
    font 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

  60. 60
    Font 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

  61. 61
    The <strong> element makes text
    _____
    by default.
    Hint

    This inline element adds emphasis through visual weight.

    Answer

    bold

  62. 62
    The <u> element creates text that is
    _____
    .
    Hint

    This element is often used to indicate a hyperlink or emphasis.

    Answer

    underlined

  63. 63
    Setting text-align: center on a block element centers its
    _____
    content horizontally.
    Hint

    This property affects inline content inside the block.

    Answer

    text

  64. 64
    The line-height property sets the amount of space
    _____
    lines of text.
    Hint

    This affects vertical spacing within a paragraph.

    Answer

    between

  65. 65
    The text-decoration property can add an
    _____
    to text, as used for underlining links.
    Hint

    It also supports values like overline and line-through.

    Answer

    underline

  66. 66
    Media queries allow you to apply CSS styles based on the
    _____
    of the viewport.
    Hint

    They use conditions like max-width to trigger different layouts.

    Answer

    size

  67. 67
    A media query with @media (max-width: 600px) applies styles only when the viewport is 600 pixels or
    _____
    .
    Hint

    max-width means the condition is true at that width and below.

    Answer

    less

  68. 68
    The 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

  69. 69
    In 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

  70. 70
    The 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

1 of 70
Question 1 of 70

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent