Get the App
SLTechnology News&Howtos  ›  Development  › 

How to generate multi-line dt and dd side by side in CSS

Shulou Source: shulou.com Published: 2022-06-01 07:36:37 10月03日 Update

This article mainly introduces how to generate multi-line dt and dd side by side in CSS. The article is very detailed and has certain reference value. Interested friends must read it!

How to realize dt and dd side by side

Use the description method of "definition list"

Title

Catalogue

Title

Catalogue

Like this, write the title and content continuously. If you want to arrange [title] and [content] horizontally, you can't write like a table, or even if you use floats, there is no place to write clearfix.

In this case, using "float:left;" and "margin-left", you can achieve a side-by-side approach.

Give float:left; the way to give margin-left the part that loses height there.

If this is the case, even if the content becomes multi-line, it can not destroy the appearance.

Let's look at an example.

Suppose you write updates to the Web site. First, let's write HTML.

Then, write CSS,float-left to, and write margin-left in (it seems that 80px is better around here. ),

HTML

October twentieth

Text is added

Multiple lines of content appear

October twentieth

Text is added

October eighteenth

Website renewal

CSS

Dt {

Float:left

}

Dd {

Margin-left:80px

}

The above is all the content of the article "how to generate multi-line dt and dd side by side in CSS". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Content multiline title method reality generation text catalogue article value information practice interest place appearance example boy partner situation time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno macOS Docker Linux Shulou Information