Home >Web Front-end >HTML Tutorial >html/css two divs on the same line

html/css two divs on the same line

WBOY
WBOYOriginal
2016-09-20 03:30:021902browse

When designing the interface, it is often necessary to display two divs on the same line.

But I always forget how to do it, so here is an essay and a memo.

To display the "first div" and "second div" on the same line as follows:

/*Outer div*/

   

First div

   

Second div

You only need to add css styles to id2 and id3, as shown below:

/*Outer div*/

float:left;">First div

float:left;">Second div

That’s it. It's very simple.

Statement:
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