Forums

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

Home Forums CSS max-width

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #248145
    Cosina
    Participant

    Hello, I don’t understand the difference between max-width alone and max-width with width:100%.
    If we tell about responsive layout, it is better to write:

    width:100%
    max-width: 900px

    or only:

    max-width: 900px

    Or there is not difference? Thanks and regards..

    #248148
    tomnoble92
    Participant

    No Difference, unless someone can tell me otherwise.

    I do write

    max-width:1200px;
    width:100%;

    #248161
    Cosina
    Participant

    Thank you very much..

    #248163
    Shikkediel
    Participant

    If the element is a div for example (with default positioning and block level display), it will automatically have a width of 100% anyway…

    Of course if the element is absolutely positioned, it will need the width to be declared explicitly.

    Edit:

    default positioning

    Or relative…

    #248165
    Cosina
    Participant

    Thanks Shikkediel..

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