HTML Basics Quiz
10 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does the HTML element define for text?

  • Subscripted text (correct)
  • Highlighted text
  • Bold text
  • Underlined text

Which of the following is NOT a way to add styling with CSS?

  • Dynamic styling (correct)
  • External styling
  • Inline styling
  • Internal styling

What is the correct CSS syntax for applying a property to an element?

  • element { value:property; }
  • element { property:value; } (correct)
  • property { element:value; }
  • value { element:property; }

Which property controls the text color of an element in CSS?

<p>color (C)</p> Signup and view all the answers

What can be added to HTML for documentation purposes without displaying it in the browser?

<p>Comments (C)</p> Signup and view all the answers

What is the purpose of the HTML element?

<p>To define a block of pre-formatted text (C)</p> Signup and view all the answers

Which of the following is true about HTML heading tags?

<p>They are numbered from <h1> to <h6>. (D)</p> Signup and view all the answers

What does the hr tag create in an HTML document?

<p>A horizontal line (D)</p> Signup and view all the answers

What is an empty HTML element?

<p>An element with no content and no closing tag (D)</p> Signup and view all the answers

How can you change the default style of an HTML element?

<p>By using the style attribute (B)</p> Signup and view all the answers

Study Notes

HTML Basics

  • HTML documents must start with a type declaration and are structured between <html> and </html> tags.
  • The visible section of the HTML document exists between <body> and </body>.
  • HTML headings are defined using <h1> to <h6> tags, indicating different levels of importance.
  • Paragraphs in HTML are created using the <p> tag and generally require an end tag.

HTML Elements

  • HTML elements are composed of a start tag, an end tag, and content in between.
  • Some elements may not require an end tag, known as empty elements (e.g., <br>, <hr>).
  • The <br> tag creates a line break, and <hr> creates a horizontal line, differentiating sections.

Displaying Preformatted Text

  • The <pre> tag is used to display pre-formatted text, preserving spaces and line breaks, ideal for poetry or formatted text.

CSS Styling

  • CSS (Cascading Style Sheets) is utilized to change the default styles of HTML elements, such as background color, text color, and font size.
  • Three methods for applying CSS: inline (within HTML elements), internal (using <style> within <head>), and external (linking to a separate CSS file).
  • Inline styles are useful for unique element styling, while internal styles apply to all elements in a document.

CSS Properties

  • CSS syntax includes specifying the element, properties, and values (e.g., element {property: value;}).
  • Common CSS properties include color, font-family, and font-size.

The Box Model

  • Every visible HTML element has an invisible box around it, defined by the CSS box model, including properties like border.

Identifying Elements

  • Use the id attribute for unique elements and the class attribute for a group aspect to define specific styles.
  • HTML links are created using the <a> tag with the href attribute specifying the destination URL, allowing navigation between documents.
  • Local links can use relative URLs, while absolute URLs specify full paths.

Images in HTML

  • Images are defined using the <img> tag, which includes attributes like src (source URL) and alt (alternative text).
  • The width and height attributes or styling can control image dimensions.

HTML Tables

  • Tables are created using the <table>, <tr>, <th>, and <td> tags, with styles controlling borders and padding.
  • Captions can be added with the <caption> tag to describe the table's content.

HTML Lists

  • Unordered lists start with <ul> and each item with <li>, utilizing bullets.
  • Ordered lists begin with <ol> and also use <li> for items, which can be numbered or styled with types including uppercase letters and Roman numerals.

Description Lists

  • Description lists are defined with <dl> for the list, <dt> for terms, and <dd> for descriptions, providing a structured way to convey information.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Introduction to HTML & CSS PDF

Description

Test your knowledge on the basics of HTML. This quiz covers essential topics such as HTML document structure, how to save HTML files, and viewing them in a browser. Perfect for beginners looking to understand web development fundamentals.

More Like This

HTML Basics Quiz
8 questions

HTML Basics Quiz

AmiableMountainPeak avatar
AmiableMountainPeak
HTML Basics: Structure and Introduction
6 questions
HTML Basics for Beginners
10 questions
HTML Basics and JavaScript Programming
8 questions
Use Quizgecko on...
Browser
Browser