Fixed center alignment of a div

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Phox
    New Member
    • Apr 2008
    • 4

    Fixed center alignment of a div

    Hey there, I'm an amateur web designer with a rather important problem at hand: I have a centered div with content outside the main container, and when I resize my browser the centered div tries to recenter, infringing on my other content. I have no problem keeping it in the center, but I'd like it to scroll horizontally when resized instead of recentering. The CSS I have on the main container is currently

    Code:
    #content-body {border: 1px solid #999; background: #CCF; margin-left: auto; margin-right: auto; width: 777px; height: 901px; text-align: left;}
  • Phox
    New Member
    • Apr 2008
    • 4

    #2
    Originally posted by Phox
    Hey there, I'm an amateur web designer with a rather important problem at hand: I have a centered div with content outside the main container, and when I resize my browser the centered div tries to recenter, infringing on my other content. I have no problem keeping it in the center, but I'd like it to scroll horizontally when resized instead of recentering. The CSS I have on the main container is currently

    Code:
    #content-body {border: 1px solid #999; background: #CCF; margin-left: auto; margin-right: auto; width: 777px; height: 901px; text-align: left;}
    site is www.freewebs.com/phoxhound

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      Instead of auto on the left-margin, change it to the width of whatever is on the left of that (forgot to look).

      Comment

      Working...