Questions and Answers
- Which image matches the flex layout defined in this style rule?
- ![A](images/Q1-A.jpg)
- [x]
- ![C](images/Q1-C.jpg)
- ![D](images/Q1-D.jpg)
- Variables declared with the let keyword have what type of scope?
- function scope
- block scope
- inline scope
- global scope
- Why would you surround a piece of text with `` tags?
- to indicate that this text is the main heading on the page
- to make the text bold
- to ensure that search engines treat the keywords as being important for this page
- to demonstrate to screen readers that this text is important
- When might an empty alt attribute be the correct value?
- when you cannot think of useful alt text
- when you don't think it would be interesting to someone who cannot see it
- when the image has come from a CMS
- when the image is purely decorative
- Which attribute must have a unique value each time it is used in an HTML document?
- title
- class
- style
- id
- Which CSS property will not trigger layout recalculation?
- top
- opacity
- width
- height
- What will be the value of selected?
- log
- apple
- stone
- turnip
- What does the `===` comparison operator do?
- It sets one variable equal to another in both value and type
- It tests for equality of type only
- It tests for equality of value only
- It tests for equality of value and type
- In the following code, the variable `fruit` has been assigned a value of apple. How would you change the value to plum?
- `let fruit = 'plum'`
- `var fruit = 'plum'`
- `const fruit = 'plum'`
- `fruit = 'plum'`
- What is the `
- to identify the difference parts of a figure
- to explain what needs to be entered into a form field
- as a caption for images
- as a heading for tables
- The browser finds some CSS that it does not understand. What is likely happen?
- The page will not display
- An error message will be displayed
- The browser will not load the stylesheet
- The browser will ignore the unknown CSS
- In this code, what is the term for the h1?
- selector
- combinator
- declarator
- markup
- Which HTML will result in text being highlighted in yellow?
- `#BLM`
- `#BLM`
- `
#BLM` - `#BLM`
- Which choice is not a value of the type attribute of the `` element?
- range
- address
- date
- password
- You have used `display: none` in your stylesheet. Which users will be able to see or hear this content?
- all users
- users who can see the content on screen
- no users
- screen reader users
- Which choice is not part of CSS box model
- margin
- border
- padding
- paragraph
- Which part of the URL `https://app.uniswap.org/pool` specifies the domain name
- https
- org
- uniswap.org
- app.uniswap
- Which HTML element is not considered a landmark element?
- `
- `
- `
- `
` - `
- Which statement is true when an HTML tag has been deprecated?
- It employs code that can be viewed only on a desktop computer
- It is obsolete and is not recommended for use in marking web content
- It employs code that will require users to update their browsers
- It employs incorrect syntax that will cause the browser to crash
- How does the rem unit represent a font size?
- Font sizes are expressed relative to the font size of the containing div element
- Font sizes are expressed relative to the font size of the parent elements
- Font sizes are relative to the base font size of the operating system.
- Font sizes are relative to the root em unit used in the HTML element.
- Which HTML element represents either a scalar value within a known range OR a fractional value?
- `
` - `
` - `
- `
- What is Webpack primarily used for?
- sharing JavaScript code with other people
- making JavaScript-reliant sites accessible to users who do not have JavaScript turned on
- bundling individual JavaScript files for use in your website
- source control
- How many columns will there be, given this code?
- one
- three
- four
- two
- Which style will change the color of the text?
- A
- B
- C
- D
- You find this code in a stylesheet. What is it being used for?
- inserting content that cannot be seen by screen readers
- fixing an Internet Explorer 11 bug
- clearing floats in float-based layouts
- creating a new block formatting context
- What is the correct way to initialize an array of galaxies in JavaScript?
- `String[] galaxies = new Array("Milky Way", "Whirlpool", "Andromeda");`
- `let galaxies = {Milky Way, Whirlpool, Andromeda};`
- `galaxies = ["Milky Way", "Whirlpool", "Andromeda"];`
- `var galaxies = {"Milky Way", "Whirlpool", "Andromeda"};`
- Which description correctly describes the initial values of flex items if the only thing you have done is apply `display: flex` to their parent?
- Items display in a row, lined up at the start, and do not stretch to fill the container
- Items display in a column, lined up at the start, and do not stretch to fill the container
- Items stay in a column until you add some flex properties.
- Items display in a row, lined up at the start, and stretch to fill the container
- Which line of code, if applied to all flex items in a flex container, would cause each flex item to take up an equal share of the total width of the container? For example, if there are four items, they would get 25% of each/
- `flex: 1 0 0;`
- `flex: initial;`
- `flex: 1 1 auto;`
- `flex: 1 0 auto;`
- A video on your webpage does not display and the console shows an error about mixed content. What is happening?
- The webapge is using a DOCTYPE, which renders it incapable of displayed video in addition to other web content.
- Your browser does not support HTML5 video.
- The video is from a source that cannot be displayed in your location for legal reasons.
- The page is loaded via HTTPS, but the video is being served insecurely as HTTP and the browser is blocking it.
- What will this loop print?
- skrt skrt skrt
- skrt skrt
- skrt skrt skrt skrt
- nothing
- You have placed an image in a directory named images and want to reference it from a page located in the root of your site. Which choice would correctly display the image on the page?
- < img src="image.jpg">
- < a href="images/image.jpg">
- < img src="images/image.jpg">
- < img href="image.jpg">
- Which choice is a correct use of the parseInt() function in Javascript that parses a string and return an integer?
- parseInt("six");
- parse_int('6');
- parseInt("6");
- parseint("6");
- How can you rewrite this function using arrow function syntax?
- let product => (x,y) {
x \* y;
} - let product = (x,y) => x\*y;
- let product => x\*y;
- let product = (x,y) -> x\*y;
- Lighthouse is a tool for auditing your website. Which choice is not a category of report offered by Lighthouse?
- performance
- UX design
- accessibility
- SEO
- In the context of this code, how would you describe user?
- function
- array
- variable
- object
- A webpage has `rel="preconnect"` added to a link resource. What will this do?
- It will tell the browser that this link is a site belonging to the current domain.
- It will do nothing a because this is a deprecated attribute that browsers do not support.
- It will tell the browser that a connection will be made to another origin and to start getting ready as soon as possible.
- It will tell the browser that a resource is needed, and that it should start getting fetched as soon as possible.
- Which choice is _not_ a render blocking resource?
- images
- HTML
- CSS
- JavaScript
- Which choice does _not_ provide information on browser support for a particular CSS property?
- the "Can I Use" website
- the Web Platform Tests Suite
- the CSS specification
- MDN property pages
- You have a set of images that are slightly different sizes and aspect ratios. You don't mind if you crop off some of the image, but you want each image to completely fill a square box without being distorted. Which property and value would achieve this?
- object-fit: contain
- object-fit: stretch
- object-fit: all
- object-fit: cover
- what does the CSS selector a[href$="org"] select?
- Which choice is not of invoking strict mode in JavaScript?
- it eliminates some JavaScript silent errors by changing them to throw errors.
- it prohibits some syntax likely to be defined in future versions of ECMAScript.
- it forces the writing of valid HTML and CSS.
- it fixes mistakes that make it difficult for JavaScript engines to perform optimizations.
- In normal flow, some elements display as block elements default and others inline. which choice contains only block-level by default elements?\*\*
- ul, li, a
- p, b, h3
- div, p, em
- div, main, h1
- Which line would you add to this code to add "Cosmos" to the list of currencies using JavaScript?
- `currencies.push("Cosmos");`
- `Array.append("Cosmos", currencies);`
- `currencies.add("Cosmos");`
- `currencies(2) = "Cosmos";`
- How would you change this code to make Vanilla selected by default?
- ``
- ``
- ``
- ``
- **\_** moves an element completely out of the page's normal layout flow, like it is sitting on its own separate layer. From there, you can fix it in a position relative to the edges of the page's `` element (or its nearest positioned ancestor element)?
- Sticky positioning
- Absolute positioning
- Relative positioning
- Fixed positioning
- You have created a box that has a height set with CSS. Which line of CSS would add scroll bars if the content is taller than the box, but leave no visible scroll bars if the content fits into the box?
- .box { overflow: scroll; }
- .box { overflow: scroll-x; }
- .box { overflow: auto; }
- .box { overflow: none; }
- Which array method should you apply to run a function for every item within an array, returning an array of all items for which the function is true?
- every()
- map()
- forEach()
- filter()
- The image below has float: left applied. Text wraps the float on the right and bottom. How would you force the second paragraph to start underneath the float, leaving a gap after the preceding paragraph?
- Apply `float: left` to the second paragraph.
- Apply `clear: right` to the floated item.
- Apply `clear: left` to the second paragraph.
- Apply `clear: left` to the floated item.
- You want to create striped table rows using CSS without adding a class to any element. Which CSS would correctly apply the background color to every odd row in your table?
- `tr:nth-child(2) { background-color: #ccc; }`
- `tr:nth-child(2n+1) { background-color: #ccc; }`
- `tr:nth-child(2+1) { background-color: #ccc; }`
- `tr:nth-child(2n) { background-color: #ccc; }`
- You are designing a site and creating a navigation bar linking to the main sections. Which HTML element should you use to indicate that this is the main navigation?
- `
- `
` - `
` - `
- `
- You discover that CSS is being loaded on a website using the following code. Why might a web developer have done this?
- The CSS is being loaded asynchronously in order to prevent render blocking.
- This will stop the CSS being loaded for old browsers that do not support the techniques in use.
- This is part of a stylesheet-switching script to load different themes for the site.
- This will stop the CCS being loaded on slow data connections.
- The flex property is often applied to flex items with a value of 1. Using flex: 1 is a shorthand - what does it unpack to?
- flex: 0 0 100;
- flex: 1 0 0;
- flex: 0 0 auto;
- flex: 1 1 auto;
- What does the term "tree shaking" mean with regard to JavaScript performance?
- only using code that is supported by the newest browsers, and serving the site without JavaScript to old browsers
- removing unused code from the JavaScript files
- splitting code into various bundles so that decisions can be made on loading priority
- allowing the browser to ignore code it believes will perform badly
- What is WebP?
- a method of auditing performance that gives your site a score, which is then used for Google ranking
- a next-generation image format offering a smaller file size than equivalent PNG or JPEG images
- a new font format that allows a single font to display at different styles and weights
- a next-generation PDF format that offers a smaller file size and better accessibility than standard PDF documents
- Your website uses CSS Grid Layout extensively, and a visitor who navigates using the keyboard tells you that they seem to jump erratically all over the screen when navigating. What is the most likely problem?
- The visitor's browser does not have full support for CSS Grid Layout.
- Items have been positioned in such a way that they are in a different order to the source.
- The browser has a keyboard navigation bug.
- You need to add the tabindex attribute to elements.
- What is the definition of the phrase ?Time to Interactive??
- when the browser displays the first bit of content from the DOM
- when the user can consistently interact with all of the page elements
- when HTML has loaded, but not necessarily JavaScript, CSS, or images
- when the user can see the webpage on the screen
- What is yarn?
- a JavaScript framework that is leaner than React
- a JavaScript bundler
- a testing framework
- a JavaScript package manager
- What is the name of the event that occurs when the mouse pointer hovers over an element?
- load
- mouseover
- hover
- focus
- What is meant by the term "polyfill" when used in web development?
- It is a piece of code that provides modern functionality in browsers that do not support it.
- It is a piece of code that hides broken content from old browsers.
- It is a term for languages such as Saas that compliles to CSS.
- It is a script that runs to add vendor prefixes to modern CSS.
- Which choice is _not_ a JavaScript framework?
- Angular
- Laravel
- Vue
- React
- What does setting `aria-live=polite` on a live region achieve?
- The screen reader will not notify the user of changes to live regions.
- The screen reader will wait until there is a pause to announce changes.
- The screen reader will announce all changes immediately.
- The screen reader will use a polite voice when announcing changes.
- Review the CSS below. What color would you expect the background color of the element with a class of .box to be?
- black
- blue
- transparent
- white
- Which CSS property and value would correctly remove the bullets from a list item?
- `list-tem: none`
- `bullets: hidden`
- `list-style-type: none`
- `list-bullet: none`
- Which code example would center `.box` inside `.container`?
- A
- B
- C
- D
- CSS Logical Properties and Values now have wide-ranging support in browsers. If you wanted to use the logical version of `width`, which property name would you choose?
- `block-width`
- `inline-size`
- `inline-width`
- `block-size`
- Which color value will create a background color that is semitransparent?
- `rgb(18, 138, 125)`
- `#128a7d`
- `rgba(18, 138, 125,.5)`
- `hsl(174, 77%, 31%)`
- In a grid layout, which property will create gaps between the rows in the grid?
- `row-gap`
- `rowgap`
- `gutter`
- `row-gutter`
- You are creating a responsive design, but when you view your site on a smaller screen, you notice that images are causing a horizontal scroll bar. How can you solve this problem without stretching any images out of shape?
- Set `object-fit: contain` on the images.
- Set `max-width: 100%` on the images.
- Set `width: 100%` on the images.
- Set `resize: true` on the images.
- The CSS box model describes how the parts of a CSS box fit together and the size of the box. What is the actual width of the following box's visible part under the standard box model?
- 230px
- 220px
- 200px
- 260px
- Which choice is not a value of the type attribute of the `` element?