473,394 Members | 1,738 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,394 software developers and data experts.

What is the art of centering a div in the mist of absolute positioning?

Here is the code:

http://cartoper.ueuo.com/centering.htm

How do I get the big blue buttons to center themselves on Firefox and
Safari on this web site?

I know that the layout is a bit complex, but there is a reason for it,
have a look at this site:

http://pahountis.zenfolio.com/p925877948

My final objective is to implement a fluid gallery similar to this
site. The way I am seeing it now, after placing one image div in the
contentAll div, I can use JavaScript to get the size of the contentAll
div and the image div to calculate the total number of images can fit
without them leaving the page. Yes, I know this site uses a ton of
JavaScript. My site will be running in an environment where I am able
to require JavaScript to be enabled.

Cartoper

Sep 30 '07 #1
11 1980
Cartoper wrote:
Here is the code:
Why can't you stick to one thread? If this is too difficult for you,
get a real newsreader and stop using that awful Google Groups interface.

You _are_ aware this is Usenet, not Google, aren't you?

--
-bts
-Motorcycles defy gravity; cars just suck
Sep 30 '07 #2
On Sep 30, 9:56 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
Cartoper wrote:
Here is the code:

Why can't you stick to one thread?
The same exact reason why I will, from time to time, through out code
and start over: Things get old, off topic, and out of context.
Sometimes you simply need to start fresh and new to get new thoughts
and ideas on a subject. I am simply trying to refocus on the real
question at hand, how to center the things I needed centered rather
then focusing on my philosiphy of pixel counting.
You _are_ aware this is Usenet, not Google, aren't you?
There is a chance I have been around the usenet longer then you, don't
know... I have been using Usenet since the early 90's. What I have
found interesting is that the places I have worked over the years
don't allow NTP through their firewall, but they do allow HTTP! That
and how Google (and Deja News back in the day) keeps track of all my
posting, I have simply come to like their interface.

Cartoper

Sep 30 '07 #3
In article
<11*********************@k79g2000hse.googlegroups. com>,
Cartoper <ca******@gmail.comwrote:
Here is the code:

http://cartoper.ueuo.com/centering.htm

How do I get the big blue buttons to center themselves on Firefox and
Safari on this web site?
You have changed the thread. I have looked at B querying this and
I agree, it loses continuity, in particular it loses that you are
unwilling to simplify your html, at the very least to start off
simple and build from there till you strike a problem. I went to
the trouble of making some html and css for you to consider as a
starting point, but what you want seems to be a "fix" for your
present, ie. some minimal thing that will make those blue buttons
move to the centre in FF and Safari (and we might also add: iCab,
Opera and probably other quite good and standards compliant
browsers). You seem not to appreciate that this sort of thing is
actually not very useful if you add the rider that "and the fix
must not have unintended bad consequences". Because, given the
context the fix will be in, ie. your over complicated code, it is
a very difficult to guarantee.

You have a set of blue buttons, one under the other. For each
there is a span surrounded by an anchor surrounded by a div; then
all buttons are surrounded collectively by another div, and the
latter is then surrounded by yet another div and more... The
function and reasoning of all these divs is not really very clear.

OK, you want one thing that will make the buttons all move to the
centre in Firefox. Do this, remove your:

div#main div
{
margin: 0;
padding: 5px;
}

entirely from the css. The absence of this makes them go to the
centre on my machine in FF.

But are we any the wiser really for the future?

--
dorayme
Sep 30 '07 #4
Cartoper <ca******@gmail.comwrites:
On Sep 30, 9:56 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
>Cartoper wrote:
Here is the code:

Why can't you stick to one thread?

The same exact reason why I will, from time to time, through out code
and start over: Things get old, off topic, and out of context.
>You _are_ aware this is Usenet, not Google, aren't you?

There is a chance I have been around the usenet longer then you, don't
know... I have been using Usenet since the early 90's.
In another reply you refer to this as "17 threads" rather than as one
thread with 17 replies. Here, you apparently expect threads to focus
strictly on your question without straying.

Given that you're behaving like a typical usenet newbie, I find your
claims to be a veteran highly doubtful.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Sep 30 '07 #5
On Sep 30, 5:09 pm, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<1191157541.195255.27...@k79g2000hse.googlegroups. com>,

Cartoper <carto...@gmail.comwrote:
Here is the code:
http://cartoper.ueuo.com/centering.htm
How do I get the big blue buttons to center themselves on Firefox and
Safari on this web site?

You have changed the thread. I have looked at B querying this and
I agree, it loses continuity, in particular it loses that you are
unwilling to simplify your html, at the very least to start off
simple and build from there till you strike a problem. I went to
the trouble of making some html and css for you to consider as a
starting point, but what you want seems to be a "fix" for your
present, ie. some minimal thing that will make those blue buttons
move to the centre in FF and Safari (and we might also add: iCab,
Opera and probably other quite good and standards compliant
browsers). You seem not to appreciate that this sort of thing is
actually not very useful if you add the rider that "and the fix
must not have unintended bad consequences". Because, given the
context the fix will be in, ie. your over complicated code, it is
a very difficult to guarantee.

You have a set of blue buttons, one under the other. For each
there is a span surrounded by an anchor surrounded by a div; then
all buttons are surrounded collectively by another div, and the
latter is then surrounded by yet another div and more... The
function and reasoning of all these divs is not really very clear.

OK, you want one thing that will make the buttons all move to the
centre in Firefox. Do this, remove your:

div#main div
{
margin: 0;
padding: 5px;

}

entirely from the css. The absence of this makes them go to the
centre on my machine in FF.

But are we any the wiser really for the future?
dorayme,

I am MUCH wiser. Thank you.

Along with the answer to the question I asked, you also shed some
light on the question I SHOULD have been asking: How do I figure out
what is wrong with my code? You answered it with "to start off simple
and build from there till you strike a problem". Thank you.

Would you mind discussing a little more exactly how you went about
finding the bug? I know from Application development, strong
debugging skills are key to most days goes smoothly, a skill I am
still trying to develop with all this web development stuff;)

Cartoper
Sep 30 '07 #6
In article
<11**********************@57g2000hsv.googlegroups. com>,
Cartoper <ca******@gmail.comwrote:
Would you mind discussing a little more exactly how you went about
finding the bug? I know from Application development, strong
debugging skills are key to most days goes smoothly, a skill I am
still trying to develop with all this web development stuff;)
I just looked at your css and html and could not work out what
the function of so many things were, in particular, the bit I
said to remove.

May I tell you a little story that exhibits a similar banality at
the base of things?

Several centuries ago, the Pope decided that all the Jews had to
leave the Vatican. Naturally there was a big uproar from the
Jewish community. So the Pope made a deal. He would have a
religious debate with the chief Rabbi of the Jewish community. If
the Jew won, the Jews could stay. If the Pope won, the Jews would
leave. The chief Rabbi's Latin wasn't very good - in fact, he
knew very little - but he was a man of great faith and well
respected in the Jewish community. The Pope agreed. What could be
easier than a silent debate?

The day of the great debate came. The Rabbi and the Pope sat
opposite each other for a full minute before the Pope raised his
hand and showed three fingers. The Rabbi looked back at him and
raised one finger. The Pope waved his fingers in a circle around
his head. The Rabbi pointed to the ground where he sat. The Pope
pulled out a wafer and a glass of wine. The Rabbi pulled out an
apple. The Pope stood up and said, "I give up. This man is too
good. The Jews can stay."

An hour later, the cardinals gathered around the Pope asking him
what happened. The Pope said: "First I held up three fingers to
represent the Trinity. He responded by holding up one finger to
remind me that there was still one God common to both our
religions. Then I waved my finger around me to show him that God
was all around us. He responded by pointing to the ground and
showing that God was also right here with us. I pulled out the
wine and the wafer to show that God absolves us from our sins. He
pulled out an apple to remind me of original sin. He had an
answer for everything. What could I do?"

Meanwhile, the Jewish community had crowded around the Rabbi.
"What happened?" they asked. "Well," said the Rabbi, "First he
said to me that the Jews had three days to get out of here. I
told him that not one of us was leaving. Then he told me that
this whole city would be cleared of Jews. I let him know that we
were staying right here." "And then?" asked a woman. "I don't
know," said the Rabbi. "He took out his lunch and I took out
mine."

--
dorayme
Sep 30 '07 #7
On Sep 30, 5:56 pm, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<1191188003.560614.220...@57g2000hsv.googlegroups. com>,

Cartoper <carto...@gmail.comwrote:
Would you mind discussing a little more exactly how you went about
finding the bug? I know from Application development, strong
debugging skills are key to most days goes smoothly, a skill I am
still trying to develop with all this web development stuff;)

I just looked at your css and html and could not work out what
the function of so many things were, in particular, the bit I
said to remove.

May I tell you a little story that exhibits a similar banality at
the base of things?

Several centuries ago, the Pope decided that all the Jews had to
leave the Vatican. Naturally there was a big uproar from the
Jewish community. So the Pope made a deal. He would have a
religious debate with the chief Rabbi of the Jewish community. If
the Jew won, the Jews could stay. If the Pope won, the Jews would
leave. The chief Rabbi's Latin wasn't very good - in fact, he
knew very little - but he was a man of great faith and well
respected in the Jewish community. The Pope agreed. What could be
easier than a silent debate?

The day of the great debate came. The Rabbi and the Pope sat
opposite each other for a full minute before the Pope raised his
hand and showed three fingers. The Rabbi looked back at him and
raised one finger. The Pope waved his fingers in a circle around
his head. The Rabbi pointed to the ground where he sat. The Pope
pulled out a wafer and a glass of wine. The Rabbi pulled out an
apple. The Pope stood up and said, "I give up. This man is too
good. The Jews can stay."

An hour later, the cardinals gathered around the Pope asking him
what happened. The Pope said: "First I held up three fingers to
represent the Trinity. He responded by holding up one finger to
remind me that there was still one God common to both our
religions. Then I waved my finger around me to show him that God
was all around us. He responded by pointing to the ground and
showing that God was also right here with us. I pulled out the
wine and the wafer to show that God absolves us from our sins. He
pulled out an apple to remind me of original sin. He had an
answer for everything. What could I do?"

Meanwhile, the Jewish community had crowded around the Rabbi.
"What happened?" they asked. "Well," said the Rabbi, "First he
said to me that the Jews had three days to get out of here. I
told him that not one of us was leaving. Then he told me that
this whole city would be cleared of Jews. I let him know that we
were staying right here." "And then?" asked a woman. "I don't
know," said the Rabbi. "He took out his lunch and I took out
mine."
I like the story, thanks!

Oct 1 '07 #8
Cartoper meinte:

[snip]
I like the story, thanks!

Still no need to post it as fullquote. *You* should know that.

Gregor

--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Oct 1 '07 #9
dorayme wrote:
In article <ae***************************@news.inode.at>,
Gregor Kofler <us****@gregorkofler.atwrote:
>Cartoper meinte:

[snip]
>>I like the story, thanks!

Still no need to post it as fullquote. *You* should know that.

Yes, I should not have done this and I regretted it.
Gregor was scolding Cartoper, who has claimed to vast years of Usenet
experience but nevertheless reposted your story in full.

That you were sensitive enough to reply with a URL and an (implied)
apology speaks to _your_ Usenet experience (and courtesy).
--
John
Pondering the value of the UIP: http://improve-usenet.org/
Oct 1 '07 #10
In article <47**********@news.bluewin.ch>,
John Hosking <Jo**@DELETE.Hosking.name.INVALIDwrote:
dorayme wrote:
In article <ae***************************@news.inode.at>,
Gregor Kofler <us****@gregorkofler.atwrote:
Cartoper meinte:

[snip]

I like the story, thanks!

Still no need to post it as fullquote. *You* should know that.
Yes, I should not have done this and I regretted it.

Gregor was scolding Cartoper, who has claimed to vast years of Usenet
experience but nevertheless reposted your story in full.

That you were sensitive enough to reply with a URL and an (implied)
apology speaks to _your_ Usenet experience (and courtesy).
So that was the point of Gregor's *s around the "you"! <g>

--
dorayme
Oct 1 '07 #11
dorayme meinte:
So that was the point of Gregor's *s around the "you"! <g>
Exactly. He stated "I have been using Usenet since the early 90's" -
something one would never guess from how and what he posts...

Gregor

--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Oct 2 '07 #12

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

Similar topics

14
by: Harlan Messinger | last post by:
What am I not understanding about the definition of { position: absolute; }? "The box's position (and possibly size) is specified with the 'left', 'right', 'top', and 'bottom' properties. These...
14
by: Marco Bakker | last post by:
http://www.iboi.nl/dev/ Tested with: Safari 1.2.2 (Mac) Firefox 0.8 (Mac) IE 5.2.3 (Mac) Camino 0.8 (Mac) IE 6 (Windows) Opera 7.5 (Mac)
9
by: Faz | last post by:
Hi I'm having some real trouble with a header I have created within a container. I have two problems; firstly the menu (a horizontal UL) will not centre within the surrounding header, despite...
15
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
6
by: Simon Wigzell | last post by:
I have the following funciton that centers my website content for any size window and will center it in real time as the window is expanded or shrunk. It is activated by a onresize="CenterIt();"...
4
by: Alan Silver | last post by:
Hello, Having been a light reader of this ng for a few months now (after several years absence), I have noticed that absolute positioning seems to be considered a Very Bad Thing around here....
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
6
by: Mark | last post by:
hi, i'm trying to position something in the top right corner of a container, but i can't seem to figure out how to get it working. here's the html <div class='thumb'><a href='image.jpg'><img...
20
by: mehstg1319 | last post by:
Hi there Not sure if anyone can help me, I am working on a site for my university, and am having a bit of trouble with css positioning. I am very new to css and do not know very much about it....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
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...

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.