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

  • 51Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: HTML Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is HTML?

Tap to flipClick to flipspace

Hypertext Markup Language - a tool used to create websites.

Or swipe the card

51 cards

  1. What is HTML?

    Hypertext Markup Language - a tool used to create websites.

  2. What is CSS?

    Cascading Style Sheets - used to style the appearance of HTML elements.

  3. What is an HTML element?

    Anything displayed on a webpage, such as a button, paragraph, or link.

  4. What is the difference between an opening tag and a closing tag?

    A closing tag has a slash before the tag name (e.g., ), while an opening tag does not (e.g., ).

  5. What is an HTML attribute?

    Modifies the behavior of an element, e.g., href on an anchor element to set the link destination.

  6. How are multiple spaces and new lines handled in HTML?

    Extra spaces and new lines are collapsed into a single space by the browser.

  7. What is a void element in HTML?

    An element that does not require a closing tag, such as <img> or <input>.

  8. How do you write a CSS rule?

    selector { property: value; }

  9. How do you target an HTML element by its class in CSS?

    Use a dot (.) followed by the class name, e.g., .subscribe-button.

  10. What is a CSS pseudo-class?

    Adds styles in a specific state, e.g., :hover for when the mouse is over the element.

  11. How do you create a smooth transition between styles in CSS?

    Use the transition property with the property to animate and the duration, e.g., transition: opacity 0.15s;

  12. What are the four values of the box-shadow property?

    Horizontal offset, vertical offset, blur radius, and color (e.g., 5px 5px 10px rgba(0,0,0,0.15)).

  13. How do you open Chrome DevTools?

    Right-click on a webpage and select 'Inspect'.

  14. How do you inspect a specific element in DevTools?

    Click the pointer icon in the top-left corner, then click the element on the page.

  15. What is the CSS box model?

    The box model consists of margin (outside spacing), border, padding (inside spacing), and the content area.

  16. What is the difference between margin and padding?

    Margin is space outside the element's border; padding is space inside the border, around the content.

  17. How do you change the font of an element in CSS?

    Use the font-family property, e.g., font-family: Arial;

  18. How do you make text bold in CSS?

    Use font-weight: bold; or a numeric value like 700.

  19. How do you center text horizontally?

    Set text-align: center;

  20. What is the <span> element used for?

    To style a specific part of text inline without affecting the whole block.

  21. What is the purpose of the <!DOCTYPE html> declaration?

    Tells the browser to use the modern version of HTML (HTML5).

  22. What is the proper structure of an HTML document?

    <!DOCTYPE html>, <html>, <head>, <body>, and all visible elements inside <body>.

  23. How do you link an external CSS file to an HTML document?

    Use a <link> element with rel="stylesheet" and href="filename.css" inside the <head>.

  24. What is a file path in HTML?

    A way to locate a file relative to the current HTML file, e.g., images/photo.jpg means go into the images folder.

  25. How do you load a Google Font onto a webpage?

    Copy the <link> tag from Google Fonts and paste it into the <head> section of your HTML.

  26. How do you display an image in HTML?

    Use the <img> element with a src attribute pointing to the image file.

  27. How do you resize an image while keeping its aspect ratio?

    Set only the width or the height in CSS, and the other dimension adjusts automatically.

  28. What is the object-fit property used for?

    Controls how an image fits its container, e.g., cover (crops to fill) or contain (fits entirely).

  29. What are the three basic display types in CSS?

    Block (takes full line), inline-block (only takes needed space, can sit beside others), and inline (within text).

  30. How do you make a block element display beside another element?

    Change its display to inline-block or use flex/grid on the parent.

  31. What is a <div> element?

    A generic container that groups elements together; by default a block element.

  32. What is the nested layouts technique?

    Combining vertical and horizontal layouts (using blocks, inline-blocks, flexbox, or grid) to recreate complex designs.

  33. How do you create a CSS Grid?

    Set display: grid; and define columns with grid-template-columns, e.g., 100px 1fr 1fr.

  34. How do you add spacing between grid columns and rows?

    Use column-gap and row-gap properties.

  35. How do you create a Flexbox container?

    Set display: flex; on the parent element.

  36. How do you center items both horizontally and vertically in Flexbox?

    Use justify-content: center; and align-items: center; on the flex container.

  37. How do you make a flex item take up remaining space?

    Set flex: 1; (or a positive number) on the item.

  38. How do you prevent a flex item from shrinking?

    Set flex-shrink: 0; on the item.

  39. What is the difference between CSS Grid and Flexbox?

    Grid is two-dimensional and more rigid (define rows and columns); Flexbox is one-dimensional and flexible based on content size.

  40. What does position: fixed; do?

    Sticks an element to the browser viewport so it stays in place while scrolling.

  41. What does position: absolute; do?

    Positions an element relative to its nearest positioned ancestor (or the page if none exists).

  42. What does position: relative; do?

    Positions an element relative to its normal position; often used as an anchor for absolute positioning of child elements.

  43. How do you create a tooltip that appears on hover?

    Place a position: absolute element inside a position: relative parent, set opacity: 0 by default, and change to opacity: 1 on hover using a pseudo-class.

  44. How do you create a notification badge on an icon?

    Wrap the icon in a position: relative container, then add an absolute element with top and right set to position it in the corner.

  45. What is a media query in CSS?

    A rule that applies styles only when certain conditions are met, e.g., screen size: @media (max-width: 750px) { ... }.

  46. How do you write shorthand for padding in CSS?

    padding: top right bottom left; (clockwise). Two values: vertical horizontal. One value: all sides.

  47. How do you write shorthand for margin?

    Same as padding shorthand: margin: top right bottom left;

  48. What is CSS inheritance?

    Some CSS properties (like color and font-family) are automatically passed from parent to child elements.

  49. What are semantic HTML elements?

    Elements that have meaning, such as <header>, <nav>, <main>, and <section>.

  50. How do you write a comment in HTML?

    <!-- comment text -->

  51. How do you write a comment in CSS?

    /* comment text */

Card 1 of 51
Card 1 of 51

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent