Page 1 of 1

css set to div block next too each other

Posted: Sun Sep 16, 2018 7:27 pm
by mister_v
Hi,

I have a problem in setting to div-boxes net to each other?

Re: css set to div block next too each other

Posted: Sun Sep 16, 2018 7:45 pm
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;
}