Results 1 to 2 of 2

Thread: CSS Layout problem

  1. #1
    Join Date
    Oct 2010
    Posts
    37

    CSS Layout problem

    Is it possible that have a fixed-width div span across the entire window. Just like a fluid layout would be 100%. If possible could anyone provide sample code.

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    Quote Originally Posted by jp504 View Post
    Is it possible that have a fixed-width div span across the entire window. Just like a fluid layout would be 100%. If possible could anyone provide sample code.
    No.

    If the width is 100% it will adjust to the width of a viewer's window.

    If fixed width it will stay fixed and create a horizontal scrollbar if necessary. You can add margin: auto to the div or page wrapper which, together with the fixed width, will center the width in larger windows and you can show a body background over the whole window.

    If you code the div with left: 0; right: 0; and position: absolute or position: fixed; the div will stretch to the full width provided the div has no width or is width: 100%.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •