

















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An exam covering foundational website development concepts including HTML structure, CSS styling, responsive layouts, typography, accessibility, and basic interactivity. Candidates answer questions about semantic markup, box model behavior, layout systems like Flexbox/Grid, and practical troubleshooting for simple web projects. Realistic tasks include assembling webpage sections, styling elements, debugging layout issues, and applying best practices for modern frontend development.
Typology: Exams
1 / 89
This page cannot be seen from the preview
Don't miss anything!


















































































Question 1. Which HTML element defines the document type and ensures the browser renders the page in standards mode? A) B) C) D) Answer: B Explanation: The `` declaration tells the browser to use HTML5 standards for rendering. Question 2. In the client‑server model, which component initiates a request for a resource? A) Server B) Router C) Client (browser) D) DNS server Answer: C Explanation: The client (usually a web browser) sends HTTP requests to the server for resources. Question 3. Which folder is conventionally used to store the main HTML file of a simple website? A) /assets B) /css C) /js D) Root directory (e.g., index.html) Answer: D
Explanation: The root directory typically contains index.html, which is the default page served. Question 4. Which of the following is NOT a typical feature of a code editor like Sublime Text? A) Syntax highlighting B) Real‑time compilation to binary C) Multiple cursors D) Find and replace Answer: B Explanation: Code editors edit source code; they do not compile code to binary automatically. Question 5. What does the browser console primarily allow developers to do? A) Edit CSS files on the server B) View and log JavaScript messages C) Change DNS records D) Upload images to a CDN Answer: B Explanation: The console displays JavaScript logs, errors, and can execute code snippets. Question 6. Which Git command creates a new local repository? A) git clone B) git init C) git commit D) git push Answer: B
Explanation: defines a third‑level heading, with decreasing importance from to . **Question 10.** Which tag is used for a paragraph of text? A) B) <p> C) D) Answer: B Explanation: <p> semantically marks a paragraph block. Question 11. To make text appear bold without implying importance, which tag is appropriate? A) <strong> B) <b> C) D) `<i>` Answer: B Explanation: `<b>` visually bolds text but does not convey extra meaning, unlike `<strong>`. **Question 12.** Which HTML element is used for inline italic text that emphasizes a phrase? A) `<i>` B) C) <strong> D) <b> Answer: B
Explanation: indicates emphasis and typically renders as italic. **Question 13.** How do you insert a line break within a paragraph? A) `<br />` B) C) D) Answer: A Explanation: <br /> forces a line break without starting a new block. Question 14. Which element creates a horizontal rule across the page? A) B) C) D) Answer: A Explanation: `` represents a thematic break and renders as a horizontal line. Question 15. Which HTML structure correctly creates an unordered list with three items? A) Item 1Item 2Item 3 B) Item 1Item 2Item 3 C) Item 1Item 2Item 3 D) Item 1 Answer: B
Explanation: _blank tells the browser to open the URL in a new browsing context. Question 19. Which of the following is a relative path? A) https://example.com/page.html B) /images/photo.jpg C) ../styles/main.css D) ftp://site.com/file.txt Answer: C Explanation: ../styles/main.css navigates relative to the current file’s directory. Question 20. Which attribute provides alternative text for an image? A) src B) title C) alt D) href Answer: C Explanation: alt describes the image content for accessibility and when the image fails to load. Question 21. In HTML, which element is considered a block‑level element by default? A) B) C) D) Answer: C
Explanation: creates a block container that starts on a new line. **Question 22.** Which element is used for an inline container without semantic meaning? A) B) C) D) Answer: C Explanation: is an inline generic container. Question 23. Which semantic tag best represents the navigation links of a site? A) B) C) D) Answer: B Explanation: groups primary navigation links. **Question 24.** Which tag would you use to wrap the main content of a page? A) B) C) D) `` Answer: C
Explanation: groups table cells into a row. **Question 28.** In a table, which element defines a header cell? A) B) C) D) Answer: B Explanation: marks a cell as a header, typically rendered bold and centered. Question 29. Which attribute of the element specifies where form data is sent? A) `method` B) `action` C) `type` D) `target` Answer: B Explanation: The `action` attribute holds the URL that receives the form submission. **Question 30.** Which input type creates a single‑line text field? A) B) C) Answer: B
Explanation: type="text" renders a standard text input. Question 31. Which input type automatically validates that the entered value is a correctly formatted email address? A) type="text" B) type="url" C) type="email" D) type="search" Answer: C Explanation: Browsers check the format of values for type="email". Question 32. Which CSS selector matches all <p> elements? A) .p B) #p C) p D) *p Answer: C Explanation: A type selector is simply the element name. Question 33. Which selector targets elements with a class of highlight? A) #highlight B) .highlight C) highlight D) *highlight
Answer: A Explanation: Inline styles (style="...") outrank external and internal rules. Question 37. Which of the following CSS declarations will make text italic? A) font-style: bold; B) font-weight: italic; C) font-style: italic; D) text-decoration: italic; Answer: C Explanation: font-style: italic; applies an italic typeface. Question 38. To center-align text inside a block element, which property is used? A) text-align: center; B) vertical-align: middle; C) margin: auto; D) align: center; Answer: A Explanation: text-align controls horizontal alignment of inline content. Question 39. Which CSS property changes the background color of an element? A) color B) background-color C) bg-color D) fill
Answer: B Explanation: background-color sets the background hue. Question 40. In the box model, which area is directly outside the border? A) Content B) Padding C) Margin D) Outline Answer: C Explanation: The margin surrounds the border, creating space between elements. Question 41. Which property adds space inside an element’s border? A) margin B) padding C) border-spacing D) gap Answer: B Explanation: padding expands the inner space between content and border. Question 42. Which CSS rule will give a 2‑pixel solid red border? A) border: 2px solid red; B) border-style: red solid 2px; C) border: solid red 2px; D) border: red 2px solid;
Answer: C Explanation: display: block; forces the element onto its own line and expands its width. Question 46. What does the CSS property float: left; do? A) Positions the element absolutely on the left side of the viewport B) Moves the element to the left and allows following content to wrap around it C) Centers the element horizontally D) Hides the element on the left side Answer: B Explanation: float takes the element out of normal flow and lets inline content flow around it. Question 47. Which HTML tag is used to link an external CSS file? A) `
Answer: C Explanation: ID selectors (#id) have higher specificity than class or type selectors. Question 49. Which pseudo‑class changes the style of a link when the mouse hovers over it? A) :active B) :visited C) :hover D) :focus Answer: C Explanation: :hover applies when the cursor is over the element. Question 50. What does the CSS selector p::first-line target? A) The first paragraph element on the page B) The first line of every <p> element C) The first child of a </p><p> element D) The first </p><p> inside a container Answer: B Explanation: ::first-line is a pseudo‑element that styles the first line of a block of text. Question 51. Which HTML attribute makes a form field mandatory? A) required B) optional C) must D) validate
Answer: A Explanation: gap (or the longhand row-gap/column-gap) defines spacing between grid tracks. Question 55. In a responsive design, which meta tag is essential for proper scaling on mobile devices? A) B) C) D) Answer: A Explanation: The viewport meta tag tells browsers how to control page dimensions and scaling. Question 56. Which CSS rule will apply only when the screen width is 600 px or less? A) @media (max-width: 600px) { ... } B) @media (min-width: 600px) { ... } C) @media screen and (width: 600px) { ... } D) @media only screen { ... } Answer: A Explanation: max-width targets viewports up to the specified width. Question 57. Which Bootstrap class creates a responsive navigation bar? A) .navbar B) .nav-bar C) .responsive-nav
D) .header-nav Answer: A Explanation: .navbar is the core class for Bootstrap navigation components. Question 58. In Bootstrap’s grid system, what does the class col-md-6 represent? A) Six columns on medium‑size screens and larger B) Half‑width columns on medium‑size screens (≥768 px) C) Six rows on medium screens D) A column that spans six rows on any screen size Answer: B Explanation: col-md-6 makes the element occupy 6 of 12 columns (50% width) on medium and larger viewports. Question 59. Which HTML element is best suited for a site’s logo that also acts as a link to the homepage? A) B) containing an C) D) Answer: B Explanation: Wrapping an in an provides both the image and the link functionality. **Question 60.** Which attribute of the tag specifies the path to the image file? A) href