vasanths294
vasanths294

Reputation: 1637

To make a div float between 2 divs

How to make a div float between two divs? Desired outcome

Could this be extended to work in different screen sizes? So that no absolute referencing is used.

Upvotes: 0

Views: 329

Answers (2)

vasanths294
vasanths294

Reputation: 1637

.contener{
  width: 100%;
  height: auto;
  text-align: center;
}

.bloc_1,
.bloc_2,
.bloc_3{
  height: 50px;
  width: calc(33.33% - 5px);
  display: inline-block;
}

Upvotes: 2

Fabien Greard
Fabien Greard

Reputation: 1894

It could be done in so many way but there somes usefull links and code :

.contener{
  width: 100%;
  height: auto;
  text-align: center;
}

.bloc_1,
.bloc_2,
.bloc_3{
  height: 50px;
  width: calc(33.33% - 5px);
  display: inline-block;
}

-inline-block

-flexbox

-grid

Upvotes: 0

Related Questions