click below
click below
Normal Size Small Size show me how
html
html language
| Question | Answer |
|---|---|
| What advice would you give a student that says their overlay section of text is appearing on the bottom, right corner of the document versus on the bottom, right corner of the element that contains the text and on which they wish to overlay the text using | Be sure the element container has position: relative declared. |
| const outputElement = document.querySelector('#output'); Write a JavaScript line of code that assigns the outputElement a class named 'highlight' using the classList property. | outputElement.classList.add('highlight') outputElement.classList.add(`highlight`); |
| Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') at util.js:45:5 | The element targeted with the addEventListener method does not exist as named. |
| const message = document.querySelector('#message'); const input = document.querySelector('#favchap'); if (input !== "") { message.innerHTML = `Thank you. Your favorite chapter is ${input}.`; } else { message.innerHTML = `Please enter a chapter.`;} | Reference the value property of the #favchap input element, not just the element. |
| What HTML5 element lets you define zero or more <source> elements, followed by one <img> element, optionally intermixed with script-supporting elements, essentially allowing you to define more than one image based on the view and browser support. | Picture |
| Optimization is the process of trying to find the magical balance between ________ and file size. | Quality |
| Device-pixel ratio is the number of device pixels per pixel. | CSS |
| Which of the following is the correct way to tell the browser how much space to reserve for the image while it loads to help prevent cumulative layout shiftsLinks to an external site.? | <img src="images/frontier.jpg" alt="Frontier Decorative Backing" width="300" height="250"> |
| What CSS property sets one or more background images on an element? | background-image |
| Should not be used on the web as it is not a compressed image format leading to very large files. | BMP |
| Simple images and animations and is older (1987). | GIF |
| Most popular choice and widely used image type for lossy compression of still images/photographs. | JPEG |
| Preferred for more precise reproduction of source images or when transparency is needed, and it produces better compression | PNG |
| Ideal for interface elements, icons, diagrams that can support many sizes with accuracy. | SVG |
| Best compression option for images and animated images with higher color depths. | WEBP |
| <picture><source srcset="images/hero-large.webp" media="(min-width: 1000px)"> <source srcset="images/hero-medium.webp" media="(min-width: 550px)"> <img srcset="images/hero-small.webp" alt="Skiing women with smile" width="500" height="250"></picture> | Good work! The HTML markup looks good for mobile first dev. |
| JavaScript uses type conversion to coerce any value to a Boolean in contexts that require it, such as conditionals and loops. A falsy value is a value that is considered false when encountered in a Boolean context. Which are JavaScript falsy values? | 0 UNDIFEINED NaN NULL ',"", OR `` |
| In the learning activity about WebP, about what % reduction of file size was discovered when converting the landscape image in the activity from JPG image file format to WebP? | 40% |
| Which of the following CSS Grid Layout properties is a shorthand to create a gutter or alley between grid cells? | gap / grid-gap |
| Which of the following is more suited for layouts in two dimensions? | Grid |
| How many columns will be displayed on the screen given the following code snippets? .wrapper { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; }Correct! | 4 |
| Which of the following code snippets will horizontally and vertically center the content of children elements within the parent container, .parent-selector? | .parent-selector { display: flex; justify-content:center; align-items: center; } |
| Progressive loading of assets on a page is also known as | Lazy loading |
| The concept of using an HTML attribute and value of loading="lazy" and the browser being able to support in versus requiring JavaScript by the user is called which of the following? | An attribute has been introduced by Google and supported by the Chrome 75+ browser named loading with three different values. Native Lazy Loading |
| To retrieve data from an existing local storage item named 'myData', which of the following statements is would you use? | localStorage.getItem("myData"); |
| To save a name as a local storage item that could be used later, you would use which of the following statements? | localStorage.setItem("name", ‘Pablo ’); |
| The attribute specifies that the input field should automatically get focus when the page loads. | Autofocus |
| Which of the following HTML snippets will produce the following table structure of data? Temperature High: 90 Low: 70 | <table class="dataA"> <tr> <td rowspan="2">Temperature</td> <td>High: 90</td> </tr> <tr> <td>Low: 70</td> </tr> </table> |
| Which of the following is an element that specifies a list of pre-defined options for an <input> element. Users will see a drop-down list of the pre-defined options as they input data into this interface. | <datalist> |
| Each input field must have a attribute to be submitted. If this attribute is omitted, the data of that input field will not be sent. | Name |
| Given the following HTML form snippet of markup, which of the following user inputs would meet the regular expression rule written in the pattern attribute? | <input type="text" name="code-mark" pattern="[A-Za-z19]{5}" title="The Code Mark"> 1cat9 |
| Which of the following input types would be the best choice for displaying choices to a user if they are only allowed to select one? | type="radio" |
| Rewrite the following HTML statement to make the input field a required field. <input type="text" name="unit">Correct | <input type="text" name="unit" required> |
| Finish the following HTML table markup by filling in the blank. | </td> or /td |
| HTML tables can be used as an effective and desired layout structure for web pages given how easy they are to markup. | False |
| JSON is written with JavaScript object notation in mind using name/value pairs. | Text |
| Finish the following JSON snippet by filling in the blank with the appropriate syntax to make this a valid name/value pair. { "temple"___"Oakland" } | : |
| const myTrip = { "month":"July", "year":"2015", "temples": ["Logan", "Bountiful", "Manti", "Draper", "St. George", "Cedar City" ] } let x = myTrip.temples[3]; | "Draper" |
| What does the acronym API stand for in the context of this week? | Application Programming Interface |
| A global fetch() method is part of the Fetch API that provides an easy, logical way to fetch resources ________________ across the network. | asynchronously |
| Convert the following concatenated string to a template string. "Welcome back " + firstName + "! You last visited on <strong>" + lvdate + "</strong>." | `Welcome back ${firstName}! You last visited on <strong>${lvdate}</strong>.` |
| JavaScript uses type conversion to coerce any value to a Boolean in contexts that require it, such as conditionals and loops. A falsy value is a value that is considered false | 0, NaN (not a number), null, undefined, '', "", or `` |
| A student has reviewed your favorite chapter application and commented that you must use innerHTML versus textContent when providing the list item's content. | li.innerHTML = item; li.textContent = item; Either property will work in this case given that item is a simple string. That would be true if item contained HTML tags. |
| const message = document.querySelector('#message'); const input = document.querySelector('#favchap'); if (input !== "") { message.innerHTML = `Thank you. Your favorite chapter is ${input}.`; } else { message.innerHTML = `Please enter a chapter.`;} | Reference the value property of the #favchap input element, not just the element. |
| write the line of code that would set a variable named "power" to equal the Eternal Flame character's second listed power given the fact that the JSON file has been parsed into a usable variable named "data". | const power = data.members[2].powers[1]; let power = data.members[2].powers[1]; |
| In JavaScript, to assign a variable identified as 'msg' a document element with a class named 'message' and it is the first element in the document with that class designation, | const msg = document.querySelector('.message’); |
| In JavaScript, to assign a variable identified as 'msg' a document element with an id named 'message', which of the following would you use? | const msg = document.getElementById('message'); const msg = document.querySelector('#message'); |
| If you wanted to change the reported temperatures coming from the OpenWeatherMaps API from the default value to Fahrenheit values, which of following would you add to your API call?rrect | &units=imperial |
| const msg = document.querySelector('span'); | The first span element found on the document. |