css tutorial css and document_experience exchange

If there is no effect of css , the block elements will be sequentially arranged one line at a time. With css, we can change the default layout mode of html and place the block elements where you want . Instead of stupidly starting a new line every time. It should be pointed out that the table tag is also a type of block element. table based layout and css based layout are common to ordinary users (excluding eyesight). From the perspective of people with disabilities, blind people, etc.), there is no other difference between the two layouts except the difference in page loading speed. However, if an ordinary user inadvertently clicks the View page source code button, the difference between the two will be very large. The css layout page source code designed based on the concept of good reconstruction can at least allow ordinary users without web development experience to convert content quickly Read it. From this perspective, css layout code should have a better aesthetic experience.
You can think of the block container element div as boxes , or if you It will be easier to understand if you have played Cut and Paste. We first cut out the necessary articles from various newspapers and magazines. The cut content of each block is a block. Then we glued these pieces of paper onto a new piece of blank paper according to our layout intention. This will form your own unique digest . As an extension of the technology, web layout design follows the same pattern. .
Inline elements(inline element) are generally based on semantic level (semantic )'s basic element. Inline elements can only accommodate text or other inline elements. The common inline element "a".
Both block element and inline element Concepts in the html specification. The basic difference between block elements and inline elements is that block elements generally start on a new line. And when css control is added, this attribute difference between block elements and inline elements does not become a difference. For example, we can add the attribute display:block to the inline element cite, so that it also has the attribute of starting from a new line every time.
The basic concept of variable elements is that it needs to determine whether the element is a block element or an inline element based on the context.Variable elements still belong to the above two element categories. Once the context determines its category, it must follow the rules of block elements or inline elements. See full text for rough element classification.
ps:About the Chinese name of inline element, there are many inline elements , inline elements, inline elements, and inline elements. Basically there is no unified translation, just call it whatever you want. In addition, when it comes to inline elements, we will think of display whose attribute is display:inline;This attribute can repair the famous IE SPAN>Double floating boundary problem.
块元素(block element)
* address - 地址
* blockquote - 块引用
* center - 举中对齐块
* dir - 目录列表
* div - 常用块级容易,也是css layout的主要标签
* dl - 定义列表
* fieldset - form控制组
* form - 交互表单
* h1 - 大标题
* h2 - 副标题
* h3 - 3级标题
* h4 - 4级标题
* h5 - 5级标题
* h6 - 6级标题
* hr - 水平分隔线
* isindex - input prompt
* menu - 菜单列表
* noframes - frames可选内容,(对于不支持frame的浏览器显示此区块内容
* noscript - )可选脚本内容(对于不支持script的浏览器显示此内容)
* ol - 排序表单
* p - 段落
* pre - 格式化文本
* table - 表格
* ul - 非排序列表
内联元素(inline element)
* a - 锚点
* abbr - 缩写
* acronym - 首字
* b - 粗体(不推荐)
* bdo - bidi override
* big - 大字体
* br - 换行
* cite - 引用
* code - 计算机代码(在引用源码的时候需要)
* dfn - 定义字段
* em - 强调
* font - 字体设定(不推荐)
* i - 斜体
* img - 图片
* input - 输入框
* kbd - 定义键盘文本
* label - 表格标签
* q - 短引用
* s - 中划线(不推荐)
* samp - 定义范例计算机代码
* select - 项目选择
* small - 小字体文本
* span - 常用内联容器,定义文本内区块
* strike - 中划线
* strong - 粗体强调
* sub - 下标
* sup - 上标
* textarea - 多行文本输入框
* tt - 电传文本
* var - 定义变量
可变元素
可变元素为根据上下文语境决定该元素为块元素或者内联元素。
* applet - java applet
* button - 按钮
* del - 删除文本
* iframe - inline frame
* ins - 插入的文本
* map - 图片区块(map)
* object - object对象
* script - 客户端脚本
<span style="FONT-SIZE: 10.5pt"></span>
<span style="FONT-SIZE: 10.5pt"><p>This is a paragraph with <em>an inline element</em> within it.</p></span>
<span style="FONT-SIZE: 10.5pt"></span>

<span style="FONT-SIZE: 10.5pt"><book></book></span>
<span style="FONT-SIZE: 10.5pt"> <maintitle>Cascading Style Sheets: The Definitive Guide</maintitle></span>
<span style="FONT-SIZE: 10.5pt"> <subtitle>Second Edition</subtitle></span>
<span style="FONT-SIZE: 10.5pt"> <author>Eric A. Meyer</author></span>
<span style="FONT-SIZE: 10.5pt"> <publisher>O'Reilly and Associates</publisher></span>
<span style="FONT-SIZE: 10.5pt"> <pubdate>2004</pubdate></span>
<span style="FONT-SIZE: 10.5pt"> <isbn>blahblahblah</isbn></span>
<span style="FONT-SIZE: 10.5pt"></span>
<span style="FONT-SIZE: 10.5pt"><book></book></span>
<span style="FONT-SIZE: 10.5pt"> <maintitle>CSS2 Pocket Reference</maintitle></span>
<span style="FONT-SIZE: 10.5pt"> <author>Eric A. Meyer</author></span>
<span style="FONT-SIZE: 10.5pt"> <publisher>O'Reilly and Associates</publisher></span>
<span style="FONT-SIZE: 10.5pt"> <pubdate>2004</pubdate></span>
<span style="FONT-SIZE: 10.5pt"> <isbn>blahblahblah</isbn></span>
<span style="FONT-SIZE: 10.5pt"></span>
<span style="FONT-SIZE: 10.5pt">默认的显示:</span>
<span> <img src="/static/imghw/default1.png" data-src="http://www.webjx.com/files/allimg/080827/0125162.png" class="lazy" alt=""></span>
<span style="FONT-SIZE: 10.5pt">用</span><span style="FONT-SIZE: 10.5pt">css</span><span style="FONT-SIZE: 10.5pt">来定义显示层次:</span>
<span style="FONT-SIZE: 10.5pt">book, maintitle, subtitle, author, isbn {display: block;}</span>
<span style="FONT-SIZE: 10.5pt">publisher, pubdate {display: inline;}</span>
<span style="FONT-SIZE: 10.5pt">现在显示:</span>
<span> <img src="/static/imghw/default1.png" data-src="http://www.webjx.com/files/allimg/080827/0125163.png" class="lazy" alt=""></span>

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

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



How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

The file upload function can be implemented through Bootstrap. The steps are as follows: introduce Bootstrap CSS and JavaScript files; create file input fields; create file upload buttons; handle file uploads (using FormData to collect data and then send to the server); custom style (optional).

The default style of the Bootstrap list can be removed with CSS override. Use more specific CSS rules and selectors, follow the "proximity principle" and "weight principle", overriding the Bootstrap default style. To avoid style conflicts, more targeted selectors can be used. If the override is unsuccessful, adjust the weight of the custom CSS. At the same time, pay attention to performance optimization, avoid overuse of !important, and write concise and efficient CSS code.

To verify dates in Bootstrap, follow these steps: Introduce the required scripts and styles; initialize the date selector component; set the data-bv-date attribute to enable verification; configure verification rules (such as date formats, error messages, etc.); integrate the Bootstrap verification framework and automatically verify date input when form is submitted.

Answer: You can use the date picker component of Bootstrap to view dates in the page. Steps: Introduce the Bootstrap framework. Create a date selector input box in HTML. Bootstrap will automatically add styles to the selector. Use JavaScript to get the selected date.

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.
