CSS inheriting div width

345
April 06, 2017, at 9:25 PM

I have essentially the following code:

<div class="parent">
  <div class="foo"></div>
  <div class="stuff"></div>
</div>

The div "foo" contains a bunch of things which will fill it up giving it a certain width and force that width on the "parent" div. I would then like the div "stuff" to obtain the same width as what "foo" is forcing on "parent", so I can left-align things in "stuff" to match with "foo".

How is this done? If I set width to 100% on "stuff", then it'll give it the width of the whole viewport instead of what the parent has. Any ideas?

Rent Charter Buses Company
READ ALSO
php include file also include the style of this file

php include file also include the style of this file

i have a PHP codes in indexphp like this:

344
How to change stacking order of bg image?

How to change stacking order of bg image?

How can I make it so that the mouth, eyes, and eyebrows appear on top of the face without changing the html? (The mouth is in the wrong position so I can see it)

314
Override path resolve for css bundling in webpack

Override path resolve for css bundling in webpack

Based on the https://githubcom/davezuko/react-redux-starter-kit repo which uses Webpack, I'm trying to implement a build process that overwrites *

545