473,473 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Fixed center alignment of a div

4 New Member
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

Expand|Select|Wrap|Line Numbers
  1. #content-body {border: 1px solid #999; background: #CCF; margin-left: auto; margin-right: auto; width: 777px; height: 901px; text-align: left;}
Apr 11 '08 #1
2 1764
Phox
4 New Member
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

Expand|Select|Wrap|Line Numbers
  1. #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
Apr 11 '08 #2
drhowarddrfine
7,435 Recognized Expert Expert
Instead of auto on the left-margin, change it to the width of whatever is on the left of that (forgot to look).
Apr 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Dave | last post by:
Hi, I have a centred table 700px wide. I'd like to use CSS instead of a table. Is the following the best, relatively standards compliant way for a non-expert to have content centred that will be...
4
by: SmithG | last post by:
I have a requirement to print text from a source thats formatting is based on a fixed font for proper presentation of column alignment. Sounds easy but......... The problem I am having is that...
2
by: Joshua Kolden | last post by:
STL allocators are templates so that when you write one you are obliged to make it work with any type. However, the Intel IPP library that we use has memory aligned allocators for each of 15...
2
by: MK | last post by:
Hi, I don't have much experience with Javascript and have a simple question. Suppose one wants to write some text in the web page which needs to be center aligned, then how to do it? The...
2
by: googley | last post by:
I'm starting a new thread for a problem that I ran into.. I'm trying to use STYLE SHEETS/CSS to update multiple table widths across many pages. I did get it working with one small problem that...
1
by: Rabbit | last post by:
Dear All I'm new to use ASP.Net for developement, can someone tell me how can I create a web form with size say 300px x 300px, align vertically center on the page Because so far I can use Div...
1
by: Jose | last post by:
Please como center a datagrid header and the data justify to right? Thanks a lot
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
8
by: Bob Altman | last post by:
Hi all, This has got to be a dumb question, but... What is the CSS property that I would use to center a table on the web page? If I set the table's Align property in the VS 2008 property...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.