WorksheetsHTML & CSS Practice Test 5
Total questions: 54
Worksheet time: 28mins
Which of the following parts is not a valid part of the CSS box model?
Padding
Absolute
Border
Content
To attach a shadow root to a custom element, you'd use which method?
element.attachShadow()
element.attachShadowRoot()
element.shadowDOM()
element.createShadow()
element.addShadowRoot()
Which of the following tag is used for drop down list?
<select>
<text>
<textarea>
<dropdown>
Which HTML tag is used to create a table?
<td>
<table>
<tabl>
<tr>
<data>
In a flex container, which property is used to control the direction of the flex items?
flex-row
flex-align
flex-wrap
flex-direction
flex-path
Which of the following is NOT a valid value for the align-items property in a flex container?
center
flex-start
stretch
baseline
space-between
Which CSS selector will select all elements that are placed immediately after a element?
div p
p:after-div
div + p
div > p
div ~ p
If you want to display controls like play, pause, and volume on an audio or video tag, which attribute should you use?
options
settings
features
controls
tools
Which tag is used to group the footer content in a table?
<tfooting>
<bottom>
<tfoot>
<footer>
<tr-foot>
What is the purpose of the aria-live attribute in HTML?
To indicate changes in content that user agents should announce.
To associate a label with an element.
To specify the level of importance of an element.
To indicate that an element can be dragged and dropped
To identify the current active element.
Which pseudo-class targets elements based on their position in a list or a sequence of child elements?
:order-child
:location-child
:sequence-child
:position-child()
:nth-child()
Which element type should be used to properly display a YouTube video?
<iframe>
<visualframe>
<h1>
<youframe>
If you want flex items to be laid out in multiple lines, what value should be used for the flex-wrap property?
wrap-reverse
fold
multi-line
nowrap
wrap
To use the Facebook JavaScript SDK in your webpage, which of these tags is most commonly added just after the opening body tag?
<meta name='facebook-sdk'>
<div id='facebook-jssdk'>
<div id='fb-root'>
<script src='facebook-sdk'>
<div fb-root>
To add an audio file to your webpage, which HTML5 tag should you use?
<m p3>
<sound>
<audio>
<play>
<music>
What is the main difference between a regular input box and a password input box?
Password boxes automatically apply RSA encryption
Password boxes mask the entered characters
Password boxes enable an encrypted connection by default
Password boxes scramble the order of the input
Which ARIA attribute is used to specify that an element controls the appearance or disappearance of another element?
aria-labelledby
aria-label
aria-live
aria-controls
aria-hidden
What is the purpose of the ‘type’ element when creating a user entry form.
To determine the CSS class to be used
To control the maximum input length
To control the positioning of the form
To control the type of input required by the user
Which pseudo-class selects elements that are the first child of their parent?
:first
:nth-child(1)
:first-of-type
:first-child
:beginning-child
What method allows an HTML custom element to be defined and registered?
document.registerElement()
document.createElement()
HTMLCustomElement.create()
window.customElements.define()
window.customElement()
Which of the following is NOT a valid timing function for CSS transitions and animations?
ease-in-out
cubic-bezier(0.1, 0.7, 1.0, 0.1)
linear
steps(4, end)
fast-slow
Which HTML5 tag is used to embed a video file into a webpage?
<embed>
<media>
<clip>
<mp4>
<video>
Which of the following is a JavaScript method commonly used to initialize and render a Google Map on a webpage?
initMap()
createMap()
showMap()
displayMap()
renderMap()
What CSS property allows you to define the number of columns in a grid layout?
grid-columns
column-count
grid-template-columns
grid-column-set
column-grid
Which pseudo-class targets only the element that the user is currently hovering over?
:active
:focus
:target
:over
:hover
To display a Facebook 'Like' button on your website, which of the following would you use?
Facebook Graph API
Facebook Plugins
Facebook Authentication
Facebook OAuth
Facebook REST API
Which of the following types of input should be used for selecting only one of several given choices?
text
radio
button
checkbox
Correctly label the different parts of the Box Model
border
content
margin
padding
The CSS box model is used when designing and laying out a page. Which sentence best describes the box model?
It is a box that encapsulates each element and its associated data entered by the user
It is a box that wraps around every HTML element on the page
It is a box that is solely for the meta data on the page
It is a box that is dragged around by the user of the page
In an HTML table, which tag represents a table row?
<thead>
<td>
<tr>
<tbody>
<column>
If you want to add a title or caption to your table, which tag should you use?
<title>
<thead>
<caption>
<label>
<header>
Which of the following is NOT a valid value for the aria-live attribute?
polite
rude
assertive
off
loud
If a button, when activated, opens a navigation menu, which ARIA attribute can be used to notify screen reader users of its expanded or collapsed state?
aria-hidden
aria-expanded
aria-pressed
aria-owns
aria-live
What is the relationship between the Content and the padding?
There is no relationship between content and padding
The contents styling is dictated by the padding
The padding creates spacing between the content and the border
The level of padding is always relative to the content above it
When integrating the Google Maps JavaScript API into a webpage, which of the following is required as a parameter in the script URL?
passcode
session
id
key
token
Which CSS property is used to define a container as a grid layout?
layout: grid;
display: block;
box: grid;
display: flex;
display: grid;
For an HTML custom element, which lifecycle callback is called when the custom element is first connected to the document's DOM?
connectedCallback()
createdCallback()
attachedCallback()
disconnectedCallback()
replacedCallback()
Which attribute in a form tag specifies the URL to which form data should be sent?
action
location
sendto
post
url
Which of the following encapsulates styles so they don't affect the outside world, and is part of the Web Components spec?
enclosed DOM
private DOM
masked DOM
hidden DOM
shadow DOM
Which of the following tags is used to represent the header of a table?
<tfoot>
<th>
<head>
<caption>
<header>
Which CSS property specifies the name of the @keyframes animation sequence you want to bind to an element?
animate-name
keyframe-name
bind-animation
animation-name
apply-animation
When used inside the <video> tag, what is the purpose of the <source> tag?
It indicates the primary server for streaming.
It provides a backup link in case the video fails.
It defines the source of the video’s transcript.
It points to an external website where the video is hosted.
It specifies alternative video files for browsers that don't support the main file.
To create a repeating back and forth animation effect, which animation-direction value would you use?
replay
backwards
alternate
reverse
loop
Which attribute would you use within the <video> tag to automatically start the video when a user lands on the page?
playonload
run
start
initiate
autoplay
Which HTML tag is used to create a form?
<input>
<submit>
<textbox>
<form>
<fieldset>
Which ARIA attribute can be used to provide a description to an element that requires a longer description than what a label can provide?
aria-owns
aria-details
aria-describedby
aria-role
aria-labelledby
Which CSS selector will select all <p> elements that are placed immediately after a <div> element?
p:after-div
div p
div > p
div + p
div ~ p
Which CSS value pauses an animation and displays the current frame?
freeze
halted
stopped
none
paused
Which of the following selectors will select all <p> elements that are direct children of a <div> element?
div p
p.in-div
div ~ p
div + p
div > p
Which attribute determines the HTTP method (GET/POST) used to submit the form data?
send-method
methodology
type
method
data-send
Which phrase correctly defines the acronym SVG?
Scalable Volume Graphic
Support Vector Graphic
Support Volume Graphic
Scalable Vector Graphic
Which of the following are NOT a valid mode for the shadow DOM?
private
open
enclosed
closed
hidden
Which input type is used to create a submit button in a form?
<input type='click'>
<input type='button'>
<button type='submit'>
<input type='submit'>
<input type='go'>
Which tag in an HTML form creates a dropdown list for users?
<dropdown>
<menu>
<optionlist>
<select>
<list>
