Web front-end written test question bank HTML chapter
Apr 21, 2022 am 11:56 AMSummarized some web front-end interview (written test) questions to share with you. This article will first share with you the HTML part of the written test questions (with answers). You can do it yourself and see how many you can answer correctly!
Related recommendations: "Web Front-end Written Test Question Bank CSS Chapter"
Q1: Is <keygen>
the correct HTML5 tag?
A: Yes.
<keygen>
The tag specifies the key pair generator field to use for the form. When the form is submitted, the private key is stored locally and the public key is sent to the server. is an HTML5 tag.
Q2: <bdo>
Can labels change the text direction?
A: Yes.
<bdo>
tag overrides the default text direction.
<bdo dir="rtl">Here is some text</bdo>
Q3: Is the following HTML code correct?
<figure> <img src="myimage.jpg" alt="My image"> <figcaption> <p>This is my self portrait.</p> </figcaption> </figure>
A: Correct
<figure>
The tag specifies independent stream content (images, charts, photos, code, etc.). The content of the figure element should be related to the main content, but should have no impact on document flow if removed. Use the <figcaption>
element to add a caption to the figure.
Q4: Under what circumstances should the small tag be used? When you want to create a subtitle after an h1 title? Or should I add copyright information in the footer?
A: The small tag is generally used in copyright information and legal text. It can also be used to mark additional information in the title (visible in bootstrap), but it cannot be used to create subtitle.
The HTML Small Element (
<small>
) makes the text font size one size smaller (for example, from large to medium, or from small to x-small) down to the browser's minimum font size. In HTML5, this element is repurposed to represent side-comments and small print, including copyright and legal text, independent of its styled presentation.
Q5: In a well-structured web page, will multiple h1 tags be detrimental to SEO?
A: No impact.
According to Matt Cutts (lead of Google's webspam team and the de facto expert on these things), using multiple
tags is fine, as long as you're not abusing it (like sticking your whole page in an
and using CSS to style it back to normal size). That would likely have no effect, and might trigger a penalty, as it looks spammy.
If you have multiple headings and it would be natural to use multiple
's, then go for it.
Excerpted from: http://www.quora.com/Does-using-multiple-h1-tags-on -a-page-affect-search-engine-rankings
Q6: If you have a search results page, you want to highlight search keywords. What HTML tags can be used?
A: The <mark>
tag displays highlighted text.
The HTML
<mark>
Element represents highlighted text, i.e., a run of text marked for reference purpose, due to its relevance in a particular context. For example it can be used in a page showing search results to highlight every instance of the searched for word.
Q7: What does the scope attribute do in the following code?
<article> <h1>Hello World</h1> <style scoped> p { color: #FF0; } </style> <p>This is my text</p> </article> <article> <h1>This is awesome</h1> <p>I am some other text</p> </article>
A: The scoped attribute is a Boolean attribute. If this attribute is used, the style is applied only to the parent element of the style element and its children.
Q8: Does HTML5 support block-level hyperlinks? For example:
<article> <a href="#"> <h1>Hello</h1> <p>I am some text</p> </a> </article>
A: Supported.
The element in HTML5 appears as a hyperlink and supports any inline elements and block-level elements.
Q9: Will a new HTTP request be triggered when the following HTML code is loaded?
<img src="mypic.jpg" style="visibility: hidden" alt="My picture">
A: Yes
Q10: Will a new HTTP request be triggered when the following HTML code is loaded?
<div style="display: none;"> <img src="mypic.jpg" alt="My photo"> </div>
A: Yes!
Q11: Will main1.css be loaded and compiled in alert('Hello world')?
<head> <link href="main1.css" rel="stylesheet"> <script> alert('Hello World'); </script> </head>
A: Yes!
Q12: Does main1 have to be downloaded and parsed before main2.css is obtained?
<head> <link href="main1.css" rel="stylesheet"> <link href="main2.css" rel="stylesheet"> </head>
A: no!
Q13: Will main2.css be loaded and compiled after Paragraph 1 is loaded?
<head> <link href="main1.css" rel="stylesheet"> </head> <body> <p>Paragraph 1</p> <p>Paragraph 2</p> <link href="main2.css" rel="stylesheet"> </body>
A: yes!
[Related recommendations: html video tutorial, web front-end]
The above is the detailed content of Web front-end written test question bank HTML chapter. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To use HTML button elements to achieve clickable buttons, you must first master its basic usage and common precautions. 1. Create buttons with tags and define behaviors through type attributes (such as button, submit, reset), which is submitted by default; 2. Add interactive functions through JavaScript, which can be written inline or bind event listeners through ID to improve maintenance; 3. Use CSS to customize styles, including background color, border, rounded corners and hover/active status effects to enhance user experience; 4. Pay attention to common problems: make sure that the disabled attribute is not enabled, JS events are correctly bound, layout occlusion, and use the help of developer tools to troubleshoot exceptions. Master this

Metadata in HTMLhead is crucial for SEO, social sharing, and browser behavior. 1. Set the page title and description, use and keep it concise and unique; 2. Add OpenGraph and Twitter card information to optimize social sharing effects, pay attention to the image size and use debugging tools to test; 3. Define the character set and viewport settings to ensure multi-language support is adapted to the mobile terminal; 4. Optional tags such as author copyright, robots control and canonical prevent duplicate content should also be configured reasonably.

class, id, style, data-, and title are the most commonly used global attributes in HTML. class is used to specify one or more class names to facilitate style setting and JavaScript operations; id provides unique identifiers for elements, suitable for anchor jumps and JavaScript control; style allows for inline styles to be added, suitable for temporary debugging but not recommended for large-scale use; data-properties are used to store custom data, which is convenient for front-end and back-end interaction; title is used to add mouseover prompts, but its style and behavior are limited by the browser. Reasonable selection of these attributes can improve development efficiency and user experience.

Native lazy loading is a built-in browser function that enables lazy loading of pictures by adding loading="lazy" attribute to the tag. 1. It does not require JavaScript or third-party libraries, and is used directly in HTML; 2. It is suitable for pictures that are not displayed on the first screen below the page, picture gallery scrolling add-ons and large picture resources; 3. It is not suitable for pictures with first screen or display:none; 4. When using it, a suitable placeholder should be set to avoid layout jitter; 5. It should optimize responsive image loading in combination with srcset and sizes attributes; 6. Compatibility issues need to be considered. Some old browsers do not support it. They can be used through feature detection and combined with JavaScript solutions.

Using HTML tags, you can use the href attribute to realize page jump, open new windows, positioning within pages and email and phone link functions. 1. Basic usage: Specify the target address through href, such as accessing a web page; 2. Open a new window: add target="_blank" and rel="noopener" attributes; 3. Jump within the page: combine id and # symbol to achieve anchor point positioning; 4. Email phone link: use mailto: or tel: protocol to trigger system applications.

The main difference is that textarea supports multiple lines of text input, while inputtext is only available in a single line. 1. Use inputtype="text" to be suitable for short and single-line user input, such as username, email address, etc., and can set maxlength to limit the number of characters. The browser provides automatic filling function, making it easier to uniformly style across browsers; 2. Use textarea for scenarios that require multiple lines of input, such as comment boxes, feedback forms, support line breaks and paragraphs, and can control the size through CSS or disable the adjustment function. Both support form features such as placeholders and required fills, but textarea defines the size through rows and cols, and input uses the size attribute.

srcset and sizes are key properties for HTML implementation of responsive images. srcset provides multiple image sources and their width or pixel density, such as 400w and 800w, and the browser selects the appropriate image accordingly; sizes defines the display width of the image under different screen widths, such as (max-width: 600px)100vw, 50vw, so that the browser can more accurately match the image size. In actual use, you need to prepare multi-size pictures, clearly named, design layout in accordance with media query, and test the performance of the equipment to avoid ignoring sizes or unit errors, thereby saving bandwidth and improving performance.

The key steps to implement the draggable function include: 1. Use the draggable attribute of HTML5 to make the elements draggable; 2. Set drag data through the dragstart event; 3. Listen to the dragover and drop event processing placement logic in the target area; 4. Use the FileList object to implement drag and drop upload. The HTML5 native drag and drop API uses a series of event control processes, such as dragstart, dragover, drop, etc., where draggable custom elements need to be set to set draggable="true" and bind dragstart event, and call setData() to save data. The dr must be blocked when handling drag and drop
