471,605 Members | 1,327 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 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 1885
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Harlan Messinger | last post: by
14 posts views Thread by Marco Bakker | last post: by
15 posts views Thread by red | last post: by
6 posts views Thread by Simon Wigzell | last post: by
4 posts views Thread by Alan Silver | last post: by
5 posts views Thread by Markus Ernst | last post: by
6 posts views Thread by Mark | last post: by
20 posts views Thread by mehstg1319 | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

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.