WGU Web-Development-Applications Exam Questions
WGU Web Development Applications (KVO1) (Page 4 )

Updated On: 28-Feb-2026

Which element attaches an external CSS document to a web page?

  1. <style>
  2. <Link>
  3. <Script>
  4. <Meta>

Answer(s): B

Explanation:

To attach an external CSS document to a web page, the <link> element is used within the <head> section of the HTML document.

<link> Element:

Purpose: Links external resources, such as stylesheets, to the HTML document.

Attributes:

rel="stylesheet": Specifies the relationship between the current document and the linked resource.

href="path/to/stylesheet.css": Specifies the URL of the external stylesheet.

Example:

<head>

<link rel="stylesheet" href="styles.css">

</head>

Other Options:

<style>: Used to embed internal CSS directly within the HTML document, not for linking external CSS.

<script>: Used to embed or link to JavaScript files.

<meta>: Provides metadata about the HTML document, not for linking stylesheets.


Reference:

W3C HTML5 Specification - The link element

MDN Web Docs - <link>

By using the <link> element correctly, you can ensure that your web page is styled with external CSS, maintaining a separation of concerns and making your HTML more manageable.



A developer needs to apply a red font color to the navigation, footer, and the first two of three paragraphs on a website.

The developer writes the following code:



Which CSS archives this developer's goal?

  1. Content
  2. Padding
  3. Margin
  4. border

Answer(s): A

Explanation:

To apply a red font color to the navigation, footer, and the first two of three paragraphs on a website, the correct CSS would use the content attribute to achieve the desired styling. However, the term "content" isn't correct in the given context. The appropriate answer involves directly specifying styles for these elements using CSS selectors.

Here's the correct CSS:

nav, footer, p.standard:nth-of-type(1), p.standard:nth-of-type(2) {

color: red;

}

CSS Selectors: The selectors nav, footer, p.standard:nth-of-type(1), and p.standard:nth-of-type(2) are used to target the specific elements. The nth-of-type pseudo-class is used to select the first and second paragraphs.

Applying Styles: The color: red; style rule sets the text color to red for the specified elements.


Reference:

MDN Web Docs on CSS Selectors

W3C CSS Specification on Selectors



A web designer inserts an image into a web page.

Which CSS attribute should this designer use to ensure that there is one of pixel of space between the line image and the surrounding elements?

  1. Content
  2. Padding
  3. Margin
  4. border

Answer(s): C

Explanation:

To ensure that there is one pixel of space between the image and the surrounding elements, the margin property should be used.

CSS Margin Property: The margin property is used to create space around elements, outside of any defined borders.

Usage Example:

img {

margin: 1px;

}

In this example, the margin: 1px; rule sets a margin of 1 pixel around the image, creating the desired space.


Reference:

MDN Web Docs on Margin

W3C CSS Specification on Margin



A web designer creates the following HTML code:



Which CSS selector applies only to the first line?

  1. #Welcome
  2. .Welcome
  3. #Header
  4. .header

Answer(s): A

Explanation:

To apply CSS only to the first line of a particular HTML element, the ID selector #Welcome should be used as per the given HTML structure.

CSS ID Selector: The ID selector is used to style the element with a specific id.

Usage Example:

#Welcome {

color: red;

}

In this example, the #Welcome selector will apply the red color style only to the element with id="Welcome".


Reference:

MDN Web Docs on ID Selectors

W3C CSS Specification on Selectors



A web page has the following CSS code:



Which selector should a developer use to invoke the CSS?

  1. Attribute
  2. Style
  3. id
  4. class

Answer(s): C

Explanation:

To invoke the CSS provided, an ID selector is used. In CSS, the ID selector is used to style the element with the specific id attribute.

CSS ID Selector: The syntax for the ID selector is #id, where id is the id attribute value of the HTML element.

Usage Example:

#black {

color: black;

}

This CSS rule will apply the color: black; style to the element with id="black".

Example in HTML:

<div id="black">This text will be black.</div>


Reference:

MDN Web Docs on ID Selectors

W3C CSS Specification on Selectors



Viewing page 4 of 29
Viewing questions 16 - 20 out of 136 questions



Post your Comments and Discuss WGU Web-Development-Applications exam dumps with other Community members:

Web-Development-Applications Exam Discussions & Posts

AI Tutor