MCQs > Website Designing & Development > Front-end Development MCQs > Basic Front-end Development MCQs

Basic Front-end Development MCQ

1. 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? box {width: 200px; padding: 10px; margin: 0 15px; border: 2px 5px;}

Answer

Correct Answer: 220px

Note: This Question is unanswered, help us to find answer for this one

2. 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?

Answer

Correct Answer: Set max-width: 100% on the images.

Note: This Question is unanswered, help us to find answer for this one

3. In a grid layout, which property will create gaps between the rows in the grid?

Answer

Correct Answer: Row-gap

Note: This Question is unanswered, help us to find answer for this one

4. Which color value will create a background color that is semitransparent?

Answer

Correct Answer: Rgba(18, 138, 125,.5)

Note: This Question is unanswered, help us to find answer for this one

5. 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?

Answer

Correct Answer: Inline-size

Note: This Question is unanswered, help us to find answer for this one

6. Which CSS property and value would correctly remove the bullets from a list item?

Answer

Correct Answer: List-style-type: none

Note: This Question is unanswered, help us to find answer for this one

7. Review the CSS below. What color would you expect the background color of the element with a class of .box to be? .box { background-color: blue; Background: url(images/star.png) no-repeat left top; }

Answer

Correct Answer: Transparent

Note: This Question is unanswered, help us to find answer for this one

8. What does setting aria-live=polite on a live region achieve?

Answer

Correct Answer: The screen reader will wait until there is a pause to announce changes.

Note: This Question is unanswered, help us to find answer for this one

9. Which choice is not a JavaScript framework?

Answer

Correct Answer: Laravel

Note: This Question is unanswered, help us to find answer for this one

10. What is meant by the term "polyfill" when used in web development?

Answer

Correct Answer: It is a piece of code that provides modern functionality in browsers that do not support it.

Note: This Question is unanswered, help us to find answer for this one

11. What is the name of the event that occurs when the mouse pointer hovers over an element?

Answer

Correct Answer: Mouseover

Note: This Question is unanswered, help us to find answer for this one

12. What is yarn?

Answer

Correct Answer: A JavaScript package manager

Note: This Question is unanswered, help us to find answer for this one

13. What is the definition of the phrase “Time to Interactive”?

Answer

Correct Answer: When the user can consistently interact with all of the page elements

Note: This Question is unanswered, help us to find answer for this one

14. 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?

Answer

Correct Answer: Items have been positioned in such a way that they are in a different order to the source.

Note: This Question is unanswered, help us to find answer for this one

15. What is WebP?

Answer

Correct Answer: A next-generation image format offering a smaller file size than equivalent PNG or JPEG images

Note: This Question is unanswered, help us to find answer for this one

16. What does the term "tree shaking" mean with regard to JavaScript performance?

Answer

Correct Answer: Removing unused code from the JavaScript files

Note: This Question is unanswered, help us to find answer for this one

17. 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?

Answer

Correct Answer: Flex: 1 0 0;

Note: This Question is unanswered, help us to find answer for this one

18. You discover that CSS is being loaded on a website using the following code. Why might a web developer have done this?

Answer

Correct Answer: The CSS is being loaded asynchronously in order to prevent render blocking.

Note: This Question is unanswered, help us to find answer for this one

19. 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?

Answer

Correct Answer:

Note: This Question is unanswered, help us to find answer for this one

20. 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?

Answer

Correct Answer: Tr:nth-child(2n+1) { background-color: #ccc; }

Note: This Question is unanswered, help us to find answer for this one

21. 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?

Answer

Correct Answer: Filter()

Note: This Question is unanswered, help us to find answer for this one

22. 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?

Answer

Correct Answer: .box { overflow: auto; }

Note: This Question is unanswered, help us to find answer for this one

23. _ 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)?

Answer

Correct Answer: Absolute positioning

Note: This Question is unanswered, help us to find answer for this one

24. In normal flow, some elements display as block elements default and others inline. which choice contains only block-level by default elements?**

Answer

Correct Answer: Div, main, h1

Note: This Question is unanswered, help us to find answer for this one

25. Which choice is not of invoking strict mode in JavaScript?

Answer

Correct Answer: It forces the writing of valid HTML and CSS.

Note: This Question is unanswered, help us to find answer for this one

27. 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?

Answer

Correct Answer: Object-fit: cover

Note: This Question is unanswered, help us to find answer for this one

28. Which choice does not provide information on browser support for a particular CSS property?

Answer

Correct Answer: The Web Platform Tests Suite

Note: This Question is unanswered, help us to find answer for this one

29. Which choice is not a render blocking resource?

Answer

Correct Answer: Images

Note: This Question is unanswered, help us to find answer for this one

30. A webpage has rel="preconnect" added to a link resource. What will this do?

Answer

Correct Answer: It will tell the browser that a connection will be made to another origin and to start getting ready as soon as possible.

Note: This Question is unanswered, help us to find answer for this one

31. Lighthouse is a tool for auditing your website. Which choice is not a category of report offered by Lighthouse?

Answer

Correct Answer: UX design

Note: This Question is unanswered, help us to find answer for this one

32. How can you rewrite this function using arrow function syntax?

Answer

Correct Answer: Let product = (x,y) => x*y;

Note: This Question is unanswered, help us to find answer for this one

33. Which choice is a correct use of the parseInt() function in Javascript that parses a string and return an integer?

Answer

Correct Answer: parseInt("6");

Note: This Question is unanswered, help us to find answer for this one

34. 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?

Answer

Correct Answer: < img src="images/image.jpg">

Note: This Question is unanswered, help us to find answer for this one

35. What will this loop print? let max = 3; for (i = 0; i > max; i++) {document.write("skrt "); }

Answer

Correct Answer: Nothing

Note: This Question is unanswered, help us to find answer for this one

36. A video on your webpage does not display and the console shows an error about mixed content. What is happening?

Answer

Correct Answer: The page is loaded via HTTPS, but the video is being served insecurely as HTTP and the browser is blocking it.

Note: This Question is unanswered, help us to find answer for this one

37. 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/

Answer

Correct Answer: Flex: 1 1 auto;

Note: This Question is unanswered, help us to find answer for this one

38. Which description correctly describes the initial values of flex items if the only thing you have done is apply display: flex to their parent?

Answer

Correct Answer: Items display in a row, lined up at the start, and do not stretch to fill the container

Note: This Question is unanswered, help us to find answer for this one

39. What is the correct way to initialize an array of galaxies in JavaScript?

Answer

Correct Answer: Galaxies = ["Milky Way", "Whirlpool", "Andromeda"];

Note: This Question is unanswered, help us to find answer for this one

40. You find this code in a stylesheet. What is it being used for? .cf::after { content: '';

Answer

Correct Answer: Clearing floats in float-based layouts

Note: This Question is unanswered, help us to find answer for this one

41. How many columns will there be, given this code? .container { width: 600px; Column-width: 200px; column-gap: 50px;}

Answer

Correct Answer: Two

Note: This Question is unanswered, help us to find answer for this one

42. What is Webpack primarily used for?

Answer

Correct Answer: Bundling individual JavaScript files for use in your website

Note: This Question is unanswered, help us to find answer for this one

43. Which HTML element represents either a scalar value within a known range OR a fractional value?

Answer

Correct Answer:

Note: This Question is unanswered, help us to find answer for this one

44. How does the rem unit represent a font size?

Answer

Correct Answer: Font sizes are relative to the root em unit used in the HTML element.

Note: This Question is unanswered, help us to find answer for this one

45. Which statement is true when an HTML tag has been deprecated?

Answer

Correct Answer: It is obsolete and is not recommended for use in marking web content

Note: This Question is unanswered, help us to find answer for this one

46. Which HTML element is not considered a landmark element?

Answer

Correct Answer:


Note: This Question is unanswered, help us to find answer for this one

47. Which part of the URL https://app.uniswap.org/pool specifies the domain name

Answer

Correct Answer: Uniswap.org

Note: This Question is unanswered, help us to find answer for this one

48. Which choice is not part of CSS box model

Answer

Correct Answer: Paragraph

Note: This Question is unanswered, help us to find answer for this one

49. You have used display: none in your stylesheet. Which users will be able to see or hear this content?

Answer

Correct Answer: No users

Note: This Question is unanswered, help us to find answer for this one

50. Which choice is not a value of the type attribute of the element?

Answer

Correct Answer: Address

Note: This Question is unanswered, help us to find answer for this one

51. Which HTML will result in text being highlighted in yellow? .highlight {background-color: yellow;}