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
    Super Moderator
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2009
    Hartford, WI
    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 that he knows not is a fool, ignore him. He who knows that he knows not is ignorant, teach him. He who knows not that he knows is asleep, awaken him. He who knows that he knows is a leader, follow him.

IMN logo majestic logo threadwatch logo seochat tools logo