HighDots Forums  

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

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss What is the art of centering a div in the mist of absolute positioning? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cartoper
 
Posts: n/a

Default What is the art of centering a div in the mist of absolute positioning? - 09-30-2007 , 08:05 AM






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


Reply With Quote
  #2  
Old   
Cartoper
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 09-30-2007 , 12:13 PM






On Sep 30, 9:56 am, "Beauregard T. Shagnasty"
<a.nony.m... (AT) example (DOT) invalid> wrote:
Quote:
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.

Quote:
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



Reply With Quote
  #3  
Old   
dorayme
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 09-30-2007 , 04:09 PM



In article
<1191157541.195255.27080 (AT) k79g2000hse (DOT) googlegroups.com>,
Cartoper <cartoper (AT) gmail (DOT) com> wrote:

Quote:
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


Reply With Quote
  #4  
Old   
Sherm Pendley
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 09-30-2007 , 04:32 PM



Cartoper <cartoper (AT) gmail (DOT) com> writes:

Quote:
On Sep 30, 9:56 am, "Beauregard T. Shagnasty"
a.nony.m... (AT) example (DOT) invalid> wrote:
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


Reply With Quote
  #5  
Old   
Cartoper
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 09-30-2007 , 04:33 PM



On Sep 30, 5:09 pm, dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote:
Quote:
In article
1191157541.195255.27... (AT) k79g2000hse (DOT) googlegroups.com>,

Cartoper <carto... (AT) gmail (DOT) com> wrote:
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




Reply With Quote
  #6  
Old   
dorayme
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 09-30-2007 , 04:56 PM



In article
<1191188003.560614.220760 (AT) 57g2000hsv (DOT) googlegroups.com>,
Cartoper <cartoper (AT) gmail (DOT) com> wrote:

Quote:
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


Reply With Quote
  #7  
Old   
Cartoper
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 09-30-2007 , 07:38 PM



On Sep 30, 5:56 pm, dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote:
Quote:
In article
1191188003.560614.220... (AT) 57g2000hsv (DOT) googlegroups.com>,

Cartoper <carto... (AT) gmail (DOT) com> wrote:
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!



Reply With Quote
  #8  
Old   
dorayme
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 10-01-2007 , 05:26 PM



In article <ae62d$4700a072$557fb410$31695 (AT) news (DOT) inode.at>,
Gregor Kofler <usenet (AT) gregorkofler (DOT) at> wrote:

Quote:
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. It was a
public holiday here yesterday and I was in a momentarily festive
mood. I was also damned annoyed that I had somehow missed (or
could not find) putting this fine tale online and succumbed...
The rest you know. I can assure you, Gregor, I have since put it
up at:

http://dorayme.150m.com/jokes/pope_rabbi_debate.html

--
dorayme


Reply With Quote
  #9  
Old   
John Hosking
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 10-01-2007 , 05:49 PM



dorayme wrote:
Quote:
In article <ae62d$4700a072$557fb410$31695 (AT) news (DOT) inode.at>,
Gregor Kofler <usenet (AT) gregorkofler (DOT) at> wrote:

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/


Reply With Quote
  #10  
Old   
dorayme
 
Posts: n/a

Default Re: What is the art of centering a div in the mist of absolute positioning? - 10-01-2007 , 05:58 PM



In article <4701792f$1_3 (AT) news (DOT) bluewin.ch>,
John Hosking <John (AT) DELETE (DOT) Hosking.name.INVALID> wrote:

Quote:
dorayme wrote:
In article <ae62d$4700a072$557fb410$31695 (AT) news (DOT) inode.at>,
Gregor Kofler <usenet (AT) gregorkofler (DOT) at> wrote:

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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.