Which line of HTML code creates a horizontal rule that is 10 pixels high and occupies 20 percent of the screen?

Get more with Examzify Plus

Remove ads, unlock favorites, save progress, and access premium tools across devices.

FavoritesSave progressAd-free
From $9.99Learn more

Study for the WGU C779 Web Development Foundations Exam. Ace the test with our flashcards and multiple choice questions, complete with hints and detailed explanations. Be fully prepared for your web development certification!

The line of HTML code that correctly creates a horizontal rule with a height of 10 pixels and a width that occupies 20 percent of the screen is the one that utilizes the style attribute in the appropriate manner. This style attribute allows for direct inline CSS to be applied to the element.

In this case, specifying style="height:10px; width:20%;" not only sets the height to 10 pixels, which determines how thick the horizontal rule appears, but also configures the width to be responsive, at 20 percent of the screen width. This means that regardless of the size of the browser window, the horizontal rule will adjust its width accordingly while maintaining the specified height.

The other options do not accurately define both height and width parameters as intended for web design. For instance, choices that use height and width attributes without the style tag do not comply with modern HTML standards, as these attributes have been largely deprecated in favor of CSS for styling. Thus, option A adheres to contemporary web practices by correctly implementing inline styles.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy