1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Rep Power

    Have inner div's max-width match parent's width

    Hello, I'd like to know if there's any css rule that sets my inner div's max-width to its parent's current width, I've googled the whole day but couldn't find anything and I'm afraid I might have to do this through javascript. Since there'll be a lot of elements, manipulating DOM will likely freeze the page upon document's loading...

    JSFiddle: jsfiddle.net/D3hEd/1/
    Browser: Chrome 31.0.1650.63 m
    SO: Windows 7 64-bits
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Rep Power
    Probably just define its width as 100%. As long as the outter is define static, that will work.

    Comments on this post

    • DonR agrees : that would be the same advice I'd give without knowing anymore about the OP's situation
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him

IMN logo majestic logo threadwatch logo seochat tools logo