18 must-know HTML interview questions (with answer analysis)
青灯夜游
Release: 2021-07-16 18:39:19
forward
4887 people have browsed it
This article will share with you 18 common HTML interview questions, with answer analysis, to help you consolidate your foundation. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
HTML is one of the most widely used languages for application development on the Internet. It can take us deep into the world of Web development, Improve skills. If you want to engage in a career related to WEB development (front-end development), you must be proficient in the basics of HTML. Let’s start our review in the form of a question and answer to prepare for the upcoming journey. Paving the way for new people entering this industry. [Recommended tutorial: html video tutorial]
Q1: What is HTML?
HyperText Markup Language (HyperText Markup Language, referred to as: HTML) is a standard markup language used to create web pages. HTML Makes text more interactive and dynamic, which is the cornerstone of building websites and WEB applications. HTML allows embedding of images, tables, links, and can be used to create interactive forms. It is used to structure information.
Q2: What is the difference between HTML elements and tags? The
element represents a certain structure or semantics and usually consists of a start tag, content and end tag. The
tags are <head>, <body>, <table>, etc. enclosed by angle brackets <# Most tags for objects wrapped by ## and > appear in pairs, such as <div>
, < h1>.
<table>
Elements
Tags
## A single component of an HTML web page or document that Represents structure or semantics. For example, the
title
element represents the title of the document
HTML
The root of the document is used to mark the HTML element. For example, the head tag is used to include all head elements
in the HTML file Q3: What is the difference between block-level elements and inline elements?
<strong></strong>
Block-level element
: Occupies the entire space of its parent element (container), creating a "block". Usually browsers will create a new line before and after a block-level element to accommodate other block elements or inline elements. Includes: , <div>, <blockquote>, <img>, < ;section>、<form>、<nav>、<h1>-<h6>、< ul> and <li>
Inline elements
: only occupy the space contained in the border of its corresponding label, and can only accommodate text or other The element of the inline element. Includes: , <em>, <q>, <label>, < ;strong>, <a>, <input>
<table>##Block-level elements
Inline elements
A block-level element is drawn as a block, which can stretch to fill the entire width available to it, which is the width of its container, and Will always start on a new line
Inline elements are drawn where they are defined, and only take up as much space as absolutely necessary
Every block element is drawn on a new line Starts in a row, and the subsequent elements also start in a new row (occupy an exclusive row); the height, width, line height, and top and bottom margins of the element can be set; if the element width is not set, it occupies the space of its own parent container 100% (same width as the parent element)
On the same line as other elements, not on an exclusive line; the height, width and top and bottom margins of the element cannot be set
Q4: Что такое семантический HTML?
Семантический HTML — это стиль кодирования, в котором используется разметка HTML для улучшения семантики или значения контента. В семантическом HTML тег <b> </b> используется не для жирных операторов, а для тегов <strong></strong>, а для операторов, выделенных курсивом, он используется. не . <i> </i>, вместо этого используйте <em>.
Q5: Перечислите часто используемые теги списков
Списки участвуют в создании страниц, и существуют специальные теги, используемые для представления данных списка в HTML Теги, а именно:
<ul>
<li>
Упорядоченный список: Упорядоченный список отображает элементы в нумерованном формате, представленном <ol>tags
<li>
Неупорядоченный список: Неупорядоченный список отображает элементы в формате маркера, который представлен тегом <ul>.
<li>
Список определений: В списке определений элементы отображаются в форме определения, как в словаре, например <dl>, <dt> # Теги ## и
HTML — это семантика разметки, а содержимое документа имеет свою собственную семантику. Общие из них следующие: <ul>
<li>: используется для определения заголовка документа.
<li><nav>: определяет навигационную ссылку
<li>: используется для определения единицы измерения в документе
<li>: используется для определения независимых, самостоятельных статей
<li>
The above is the detailed content of 18 must-know HTML interview questions (with answer analysis). For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn