css set to div block next too each other

Post Reply
mister_v
Posts: 199
Joined: Thu Mar 04, 2010 9:19 pm

css set to div block next too each other

Post by mister_v »

Hi,

I have a problem in setting to div-boxes net to each other?
chris
Site Admin
Posts: 205
Joined: Mon Jul 21, 2008 9:52 am

Re: css set to div block next too each other

Post by chris »

there are probably multiple solution.

One I find easy is this one:

Code: Select all

<div id="parent">
  <div id="part1">(200px)</div>
  <div id="filling">(rest of width)</div>
</div>
CSS

Code: Select all

#parent {
  display: flex;
}
#part1 {
  width: 200px;
  background: lightblue;
}
#filling {
  flex: 1;
  /* Grow to rest of container */
  background: lightgreen;
}
Post Reply