Module 2: CSS Overview & HTML5 Elements

Spread the love

INTRODUCTION – CSS Overview & HTML5 Elements

Thus, HTML5 would be understood as a number of elements which developers can use for creating well-developed, well-diversified websites. A style sheet language is called CSS and it specifies how HTML elements should be rendered. HTML5 combined with CSS actually allows a developer to create applications that can be rich and interactive. HTML5 elements are those that are capable of distinguishing sections in an HTML document, headers and footers, various sections, headings, and then the entire body of the document.

They also have elements that can meet the needs of users who wish to provide some information to the site in formats such as dates, times, numbers, and email addresses, among other things. This flip-flop continues the process; HTML sends data to the browser, and CSS does so to make the data fashionable. Thus they can be used to achieve the shape and fashion that an individual desires for the site.

Objectives of Learning

  • To enhance websites using CSS.
  • How to format HTML elements using CSS.
  • Categories of CSS frameworks.
  • Advantages and disadvantages of CSS frameworks.
  • Basic structural elements of HTML5.
  • Attributes of HTML5 input elements.

PRACTICE QUIZ: Test your knowledge on Analytical Thinking

1. What makes a Style Sheet “Cascading”?

  • Elements inherit styles that are defined before them in a CSS document
  • Parent elements inherit styles that are defined for child elements
  • Each element has a unique style, unrelated to its’ parent 
  • Child elements inherit styles that are defined for parent elements (CORRECT)

Correct: Most styles will be inherited by a child element from its parent except for some. While there are some styles that will not be inherited automatically; these include background styles, border, padding, and many others. These should be set again on the child if needed. Certain properties are inherited, such as color and font-family.

2. Which of the following describes a Utility-first Framework? Select all that apply.

  • Provides pre-styled components and templates
  • Provides complete freedom when styling elements
  • References CSS properties via Utility Classes (CORRECT)
  • Makes HTML markup more verbose by mixing styles with content (CORRECT)

Correct: All utility-first frameworks contain utility classes, each of which corresponds to a single-purpose CSS rule.

Correct: It’s possible to make your HTML markup somewhat verbose with the use of utility classes in the class attribute of HTML elements.

3. Which of the following tags is used to separate areas in a document?

  • <div> (CORRECT)
  • <input>
  • <body>
  • <nav>

Correct: The <div> tag opens with a document into parts or divisions such as:

4. What type of element is <article>?

  • A graphic element
  • A semantic element (CORRECT)
  • An input element
  • A multimedia element

Correct:One of the semantic tags is an <article> which is intended for defining a portion of a webpage page that usually represents autonomous and self-contained meaning.

5. Which tag is used to specify self-contained content like an image, illustration, or diagram?

  • <image>
  • <figure> (CORRECT)
  • <img>
  • <figcaption>

Correct: The <figure> tag can define a self-contained image or illustration that is often referenced in the main body text.

GRADED QUIZ

1. Which of the following ways of applying CSS has the highest priority, and will override the other ways?

  • Internal CSS, applied within the “<style>” attribute in HTML markup
  • An external CSS file
  • Whichever way is specified in the HTML markup
  • Inline CSS, placed directly in each HTML element (CORRECT)

Correct: Inline CSS carries a very high degree of specificity, allowing it to override any styles defined within internal or external stylesheets. Further information can be found in the “CSS – Styling HTML” video.

2. Select all of the following which are true in describing a fluid and/or fixed layout.

  • A fixed layoutspecifies element sizes using percentages
  • Fluid layouts should always be used when designing a website
  • Fixed layouts are independent of screen sizes, and their values do not change (CORRECT)
  • Elements in a fluidlayout have flexible widths and heights (CORRECT)

Correct: Moreover, Determining the height and width of the elements means the fixed layouts will not be flexible according to the size of the devices or the screens through which a website may be accessed. For further discussion, please refer to the video designated as CSS – Styling HTML.

Correct: Fluid layout means that the width and height of the elements are flexible and change as per the size of the screen or browser widow. Check the video ‘CSS – Stying HTML’ for more details.

3. Which of the following tags define a caption for a < fieldset > element?

  • <title>
  • <caption>
  • <label>
  • <legend> (CORRECT)

Correct: Understanding and analysis of both the <legend> and <fieldset> elements as a whole, the part where <legend> is used above is only to describe further the usage of <fieldset>. Refer to the lecturing on “Additional HTML Elements” for more details.

4. What is a modifier?

  • A type of button which allows you to modify content in a form
  • The term used to refer to a JavaScript class which updates content on a webpage
  • A special class modifies the appearance of elements by applying a CSS attribute based on the condition described (CORRECT)
  • A method used to modify CSS styling applied to an HTML element

Correct: With the utility frameworks such as Tailwind CSS, modifiers are being used to conditionally apply utility classes at times as and when it’s needed on an elements. These are basically conditions that you want to address; hence, they come as a prefix to your class name. For further reach, you can check the video on “CSS Frameworks”.

5. Which semantic tag is used to display any content which is indirectlyrelated to the main content of the document?

  • <section>
  • <aside> (CORRECT)
  • <article>
  • <details>

Correct: The <aside> tag refers to content that is related to the primary content but may be separated, such as sidebars or other materials. See the Common HTML5 Tags and Structural Elements reading for more information.

6. Which type of input control would be most apt for selecting heightin a form?

  • Range
  • number (CORRECT)
  • list
  • tel

Correct: Using the number input type, however, allows users to type any custom number and makes it possible for you to control it—for example, range or step, a limit to whole numbers and maximum of 2m. See “HTML5 Input Element: Attributes for Input Tag” for more details.

7. Which of the following is a disadvantage of a Component Framework?

  • It is more difficult to maintain a uniform style throughout the website
  • HTML markup is more verbose since styles are mixed with content
  • Download size of HTML markup is increased
  • Components are limited only to what the framework provides (CORRECT)

Correct: You’re stuck using component frameworks because they provide ready-to-use components. To customize or style other elements, you generally have to consider Vanilla CSS or one other framework, for more details, describe how CSS Frameworks works video .

8. Which tag is used to represent an independent item of content in a document, which can be meaningful on its own?

  • <div>
  • <details>
  • <section>
  • <article> (CORRECT)

Correct: The <article> tag refers to portions of content, such as a blog post, news article, or forum post, that are suitable for self-containment and syndication. See more on this topic in the section “Common HTML5 Tags and Structural Elements.”

9. Which element defines a caption for the <figure> element?

  • <figcaption> (CORRECT)
  • <label> 
  • <legend>
  • <title>

Correct: The <figcaption> tag specifies a caption which is associated with content held inside a <figure> element like an image or illustration. For more information, read “Common HTML5 Tags and Structural Elements”.

10. Which type of input control can be used to accept only numbers in a form?

  • Tel
  • Number (CORRECT)
  • integer
  • digit

Correct: It accepts only numbers as input but also has numerous cool extensions, such as entering a range or step and many more. Check out the video “HTML5 Input Element: Attributes for the Input Tag” for additional information.

CONCLUSION – CSS Overview & HTML5 Elements

Thus, mastering HTML5 and CSS is crucial for web developers who wish to develop a well-structured and visually appealing website. HTML5 provides a strong base through which users can implement elements that organize content and facilitate user interaction, thus deferring to CSS to describe how everything looks. The final effect is a fascinating design that well-organized, interactive web applications may provide. Together with the access to both languages, it allows a developer to create rich and interactive web applications.

Leave a Comment