473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

'auto' value question..


at work they decided to center divs thus:

body {text-align:center}
#content {width: 612px; text-align:left; margin: 0 auto 0 auto; }

this works fine in IE & FF, EXCEPT in FF it doesn't work if I change
'auto' to 0 for left and right margin values; I have to leave those at
'auto'.. so I would like to know what exactly means 'auto' -- what
value it represents exactly (and does it apply for all elements/values
you might apply 'auto' to?)

(please don't tell me I should do this differently, I don't think they
will change the template at this point.. I had not say in it.. I just
would like to know what I can expect from 'auto' value..)

thank you very much..

Aug 1 '06 #1
5 3238
maya wrote:
>
at work they decided to center divs thus:

body {text-align:center}
#content {width: 612px; text-align:left; margin: 0 auto 0 auto; }

this works fine in IE & FF, EXCEPT in FF it doesn't work if I change
'auto' to 0 for left and right margin values; I have to leave those at
'auto'.. so I would like to know what exactly means 'auto' -- what
value it represents exactly (and does it apply for all elements/values
you might apply 'auto' to?)
It doesn't represent a value exactly. It means that you are leaving it
to the browser to figure out the best value. Of margin-left,
border-left, padding-left, width, padding-right, border-right, and
margin-right, if you specify measures for some and auto for the others,
the browser works out the autos as it thinks most suitable.
Aug 1 '06 #2
Harlan Messinger wrote:
maya wrote:
>>
at work they decided to center divs thus:

body {text-align:center}
#content {width: 612px; text-align:left; margin: 0 auto 0 auto; }

this works fine in IE & FF, EXCEPT in FF it doesn't work if I change
'auto' to 0 for left and right margin values; I have to leave those at
'auto'.. so I would like to know what exactly means 'auto' -- what
value it represents exactly (and does it apply for all elements/values
you might apply 'auto' to?)

It doesn't represent a value exactly. It means that you are leaving it
to the browser to figure out the best value. Of margin-left,
border-left, padding-left, width, padding-right, border-right, and
margin-right, if you specify measures for some and auto for the others,
the browser works out the autos as it thinks most suitable.
thanks Harlan! :)

Aug 1 '06 #3
maya wrote:
margin: 0 auto 0 auto;
This could be summarised as:

margin: auto;

saving 8 bytes. :-)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Aug 1 '06 #4
Toby Inkster wrote:
maya wrote:
>margin: 0 auto 0 auto;

This could be summarised as:

margin: auto;

saving 8 bytes. :-)
That would be margin: auto auto auto auto, not margin: 0 auto 0
auto--unless auto necessarily resolves to 0 for vertical margins. Does it?

In any event, it could definitely be abbreviated to margin: 0 auto.
Aug 2 '06 #5
Harlan Messinger wrote:
That would be margin: auto auto auto auto, not margin: 0 auto 0
auto--unless auto necessarily resolves to 0 for vertical margins. Does it?
It does.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Aug 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
5
by: Phil Latio | last post by:
I have 2 virtually identical tables and wish to move data between them. Basically one table is called "live_table" and the other is named "suspended_table" and the only difference is that the...
1
by: christophe.lemort | last post by:
Hello, Here is a basic question (I am an access dummy). I create an object in a table where the key is an auto num and therefore I do not specify the Id I my VBScript code: ...
2
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
4
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... Following the samples online, we implemented a windows service in .Net. Like most services, there's a worker thread actually doing stuff in the background. The problem we've run into is...
106
by: bonneylake | last post by:
Hey Everyone, Well i don't know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.