The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Simple liquid width problem. Is this even possible?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #25903

    Head up liquid layout gurus! I have a very simple problem that I can’t find a solution to:

    I have a container with a liquid width, fixed height, and 10px of padding.

    Within this container, another DIV needs to be absolutely positioned near the bottom, and needs to be the same width that a normal DIV would be. In other words, I need this DIV to be 100% of the width of the container, minus 20px for the container’s padding.

    The problem is that setting a DIV’s width to 100% does not take the parent element’s padding into account (which is correct CSS behavior of course), and since the container is liquid I cannot use a fixed value.

    Is there any solution to this problem?


    Got the answer from another forum. Instead of using a 100% width, you just set the left and right values to the padding value. :)

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.