This time I will bring you some common problems in HTML? How to use ordered lists, unordered lists, and custom lists? Write a simple example. What are the semantic differences between the three? What are the usage scenarios? Can it be nested?
Ordered lists are list items marked with numbers:
<ol> <li>Coffee</li> <li>Milk</li> </ol>
The effect is as follows:
<ol><li>Coffee</li> <li>Milk</li> </ol>
Unordered lists are lists marked with origins Item:
<ul> <li>Coffee</li> <li>Milk</li> </ul>
The effect is as follows:
<ul><li>Coffee</li> <li>Milk</li></ul>
The combination of items represented by the custom list plus comments:
<dt>Coffee</dt> <dd>Black hot drink</dd><dt>Milk</dt></dl>```
The effect is as follows:
><dl><dt>Coffee</dt><dd>Black hot drink</dd><dt>Milk</dt><dd>White cold drink</dd></dl>
These three lists can be nested within each other.
-
#How to remove the dots or numbers at the front of the list?
Just use CSS styles
```<style>ul{
list-style: none;
}```-
#What is the difference between class and id? When to use class and when to use id? 1.ID is unique and Class is universal. 2.ID is unique and usually used for
page layout
.
3.Class is repeatable and usually used for style definition.
4. The style priority of ID is higher than Class.
- #What are block-level elements and inline elements? What's the difference? What common tags do they correspond to? Block-level elements usually start (and end) with a new line when displayed by the browser.
Inline elements (
inline elements
) usually do not start on a new line when displayed.
Difference:
1. The block-level element will occupy a row, and its width will automatically fill the width of its parent element. Inline elements will not occupy an exclusive line. Adjacent inline elements will be arranged in the same line. They will not wrap until one line cannot fit. The width will change with the content of the element. 2. Block-level elements can set width , height attribute, inline element setting width, height is invalid3. Block-level elements can set margin and padding. The horizontal padding-left, padding-right, margin-left, margin-right of inline elements all produce margin effects, but the vertical padding-top, padding-bottom
, margin-top,
margin-bottom
will not produce margin effects.
Block-level element tags: div, p,form,ul,li,ol,dl,form,address,fieldset,hr,menu, table.
Inline element labels: span, strong, em, br, img, input, label, select, textarea, cite.
-
#What are the functions of display: block, display: inline, and display: inline-block respectively? 1.display:block: This element will be displayed as a block-level element, and there will be " Newline character. ###2.display:inline: This element will be displayed as an inline element, with no line breaks before and after the element. ###3.display:inline-block: Renders the object as an inline object, but the content of the object is rendered as a block object. Adjacent inline objects will be rendered on the same line, allowing spaces. ###- ####What is the function of the following code? ###
<div id="header">
</div>
<div id="content">
<div class="main"></div>
<div class="aside"></div>
</div>
<div id="footer">
</div>这段代码通过使用id,class对div模块进行布局,让页面呈现为页头,内容,页尾,并且在内容中分为侧栏和主栏部分。而在页面中,header,content,footer仅会出现一次,故用id标记,而content为了后期方便修改,用class标记。
- ####如何理解 HTML CSS 语义化?
通过语义化可以让人们更容易明白每个标签的作用和使用场景,比如p标签就可以理解为paragraph标签,代表一个段落。诸如此类的还有em标签,hx标签,table标签等。
- ####form表单有什么作用?有哪些常用的input 标签,分别有什么作用?
HTML通过form标签创建表单为用户提供文本字段、复选框、单选框、提交按钮等向服务器传输数据。常见的input标签有:
type 规定 input 元素的类型。
src 定义以提交按钮形式显示的图像的 URL。
checked 规定此 input 元素首次加载时应当被选中。
value 规定 input 元素的值。
name 定义 input 元素的名称。
- ####post 和 get 方式的区别?
get以 URL 变量 的形式来发送,将表单数据以名称/值对的形式附加到 URL 中。
post以 HTTP post 的形式来发送,以 HTTP post 事务的方式来传递表单数据。
- ####在input里,name 有什么作用?
name 属性规定 input 元素的名称,用于对提交到服务器后的表单数据进行标识,或者在客户端通过 JavaScript 引用表单数据。
- ####、提交、三者有什么区别?
1.定义一个按钮,。 标签之间的所有内容都是按钮的内容,其中包括任何可接受的正文内容,比如文本或多媒体内容。
2.提交是一个a标签定义的超链接,而其样式用class="btn"标记。
3.定义了提交按钮,点击并向服务器发送表单数据。数据会发送到表单的 action 属性中指定的页面。
- ####radio 如何分组?
在input标签中添加name属性进行分组。
- ####placeholder 属性有什么作用?
placeholder 属性提供可描述输入字段预期值的提示信息(hint)。该提示会在输入字段为空时显示,并会在字段获得焦点时消失。
- ####type=hidden隐藏域有什么作用?举例说明
隐藏域在页面中对于用户是不可见的,在表单中插入隐藏域的目的在于收集或发送信息,以利于被处理表单的程序
所使用。浏览者单击发送按钮发送表单的时候,隐藏域的信息也被一起发送到服务器。
相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
相关阅读:
The above is the detailed content of Frequently Asked Questions in HTML 1. For more information, please follow other related articles on the PHP Chinese website!
Two Images and an API: Everything We Need for Recoloring ProductsApr 15, 2025 am 11:27 AMI recently found a solution to dynamically update the color of any product image. So with just one of a product, we can colorize it in different ways to show
Weekly Platform News: Impact of Third-Party Code, Passive Mixed Content, Countries with the Slowest ConnectionsApr 15, 2025 am 11:19 AMIn this week's roundup, Lighthouse sheds light on third-party scripts, insecure resources will get blocked on secure sites, and many country connection speeds
Options for Hosting Your Own Non-JavaScript-Based AnalyticsApr 15, 2025 am 11:09 AMThere are loads of analytics platforms to help you track visitor and usage data on your sites. Perhaps most notably Google Analytics, which is widely used
It's All In the Head: Managing the Document Head of a React Powered Site With React HelmetApr 15, 2025 am 11:01 AMThe document head might not be the most glamorous part of a website, but what goes into it is arguably just as important to the success of your website as its
What is super() in JavaScript?Apr 15, 2025 am 10:59 AMWhat's happening when you see some JavaScript that calls super()?.In a child class, you use super() to call its parent’s constructor and super. to access its
Comparing the Different Types of Native JavaScript PopupsApr 15, 2025 am 10:48 AMJavaScript has a variety of built-in popup APIs that display special UI for user interaction. Famously:
Why Are Accessible Websites so Hard to Build?Apr 15, 2025 am 10:45 AMI was chatting with some front-end folks the other day about why so many companies struggle at making accessible websites. Why are accessible websites so hard
The `hidden` Attribute is Visibly WeakApr 15, 2025 am 10:43 AMThere is an HTML attribute that does exactly what you think it should do:


Hot AI Tools

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

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

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

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

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function






