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

html/css two divs on the same line

WBOY
Release: 2016-09-20 03:30:02
Original
1905 people have browsed it

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.

Related labels:
source:php.cn
Statement of this 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template