center two inline elements

L

Lanmind

Hello all,

Quick question, is it possible to center two inline elements next to
each other inside a block level element?

I have an input text box and input submit button next to each other
inside a <div>, I would like to have both elements next to each other
but still centered inside the <div>.

The elements have id's "text" and "submit" and the <div>'s id is
"main_search".

Here is my page and CSS:

http://www.dockhawk.com/default_test.html

http://www.dockhawk.com/default_test.css

Thanks all.
 
D

dorayme

Lanmind said:
Hello all,

Quick question, is it possible to center two inline elements next to
each other inside a block level element?

I have an input text box and input submit button next to each other
inside a <div>, I would like to have both elements next to each other
but still centered inside the <div>.

The elements have id's "text" and "submit" and the <div>'s id is
"main_search".

Here is my page and CSS:

http://www.dockhawk.com/default_test.html

http://www.dockhawk.com/default_test.css

Thanks all.

Please consider that by giving out a URL with Google map on your page,
*without* letting people know what they are in for download wise, they
might well find you have caused them to unwillingly use up their
bandwidth. Some people have tight limits and have to pay...
 
L

Lanmind

Please consider that by giving out a URL with Google map on your page,
*without* letting people know what they are in for download wise, they
might well find you have caused them to unwillingly use up their
bandwidth. Some people have tight limits and have to pay...

Hi dorayme,

I'm sorry I didn't think Google Maps would be such an issue.So some
people would be upset if they accidentally stumbled upon the Google
Maps homepage?

What kind of limitations? The only limitations I have heard of were
Comcast's new 600 GB limit but that's huge of course. I will do in the
future though.
 
D

dorayme

Lanmind said:
Hi dorayme,

I'm sorry I didn't think Google Maps would be such an issue.So some
people would be upset if they accidentally stumbled upon the Google
Maps homepage?

What kind of limitations? The only limitations I have heard of were
Comcast's new 600 GB limit but that's huge of course. I will do in the
future though.

Simple thing really, in my case I have a plan that gives me a lot more
at some times of the day and night than at other times and it is
important for me to not use up my lot for business reasons. I can
usually kill a slow loading url but sometimes the browser ignores my
attempts for a while, like a dog who knows he has been told not to catch
and tease the neighbour's cat but who nevertheless pretends not to hear
the owner's frantic calls for a while... just enough a while to get an
amount of sadistic hunting pleasure for himself without bringing down
too severe an admonition. He knows how far he can push things. It takes
me time to kill a browser through the ultimate Option Command Escape in
Mac OS X when oher techniques fail.

Have you got a simple test case without google map?
 
L

Lanmind

Simple thing really, in my case I have a plan that gives me a lot more
at some times of the day and night than at other times and it is
important for me to not use up my lot for business reasons. I can
usually kill a slow loading url but sometimes the browser ignores my
attempts for a while, like a dog who knows he has been told not to catch
and tease the neighbour's cat but who nevertheless pretends not to hear
the owner's frantic calls for a while... just enough a while to get an
amount of sadistic hunting pleasure for himself without bringing down
too severe an admonition. He knows how far he can push things. It takes
me time to kill a browser through the ultimate Option Command Escape in
Mac OS X when oher techniques fail.

Have you got a simple test case without google map?

Yes dorayme I do, here is the page and CSS:

http://www.dockhawk.com/default_test_nomap.html

http://www.dockhawk.com/default_test.css

Thank you
 
J

Jukka K. Korpela

Lanmind said:
Yes dorayme I do, here is the page and CSS:

At this point, I lost interest.

Consider learning how to post to Usenet. To get constructive help, post
constructively.
 
R

Roy A.

Please consider that by giving out a URL with Google map on your page,
*without* letting people know what they are in for download wise, they
might well find you have caused them to unwillingly use up their
bandwidth. Some people have tight limits and have to pay...

If you're using IE, you go to: Tools, Internet Options, Advanced,
Multimedia and disable "Show images".

If you're using Safari, you could go to Safari, Preferences,
Appearance and disable "Display images when the page opens".

If you're using Firefox, well isn't there several add-ons? You could
try ImgLikeOpera:

"ImgLikeOpera allows load only the images that you want in Firefox
browser. This extension is very useful for non broadband users..."

Warning: The following link might contain images:
https://addons.mozilla.org/en-US/firefox/search?q=images&cat=all
 
R

Roy A.

Hello all,

Quick question, is it possible to center two inline elements next to
each other inside a block level element?

I have an input text box and input submit button next to each other
inside a <div>, I would like to have both elements next to each other
but still centered inside the <div>.

div { text-align: center }
The elements have id's "text" and "submit" and the <div>'s id is
"main_search".

Here is my page and CSS:

http://www.dockhawk.com/default_test.html

Try to use a stripped down test case.

#main_search {
[...]
/*width: 496px;*/
text-align: center;
[...]
}
 
L

Lanmind

Hello all,
Quick question, is it possible to center two inline elements next to
each other inside a block level element?
I have an input text box and input submit button next to each other
inside a <div>, I would like to have both elements next to each other
but still centered inside the <div>.

div { text-align: center }
The elements have id's "text" and "submit" and the <div>'s id is
"main_search".
Here is my page and CSS:

Try to use a stripped down test case.

#main_search {
[...]
/*width: 496px;*/
text-align: center;
[...]

}

Thanks Roy,

I've done the text align: center; but I have some worries about that.
I'm not positive where I heard it but I thought text-align should be
used for only text and images.

I'm worried it might cause problems on some browsers or displays of
different resolutions. This is why I hadn't done that, it seems to be
ok now though so...Thanks.
 
D

dorayme

"Roy A. said:
If you're using IE, you go to: Tools, ...
[...advice on how to turn a lot of the world off...]

Thanks for telling Grandma Dorayme how to suck eggs, I would find it
very inconvenient to do most of the above. <g>

But I liked your last paragraph's warning. That is what really needs
stressing.

Anyway, Lanmind was very nice about it and I will see if I can help
him...
 
R

Roy A.

I've done the text align: center; but I have some worries about that.
I'm not positive where I heard it but I thought text-align should be
used for only text and images.

The text-align property alignes text and text level (inline) elements.
In quirk mode it aligns the table element. That isn't correct and
don't work in standards mode. To align block level elements, you use
margins, like you did.
I'm worried it might cause problems on some browsers or displays of
different resolutions.

In small displays, the content is wrapped like text.

BTW, I don't think it is wise to have 'overflow: hidden' on the html
and body element. That's not helping, it just make things
inaccessible. Design to support the content, not to hide it.
 
R

Roy A.

If you're using IE, you go to: Tools, ...

[...advice on how to turn a lot of the world off...]

Thanks for telling Grandma Dorayme how to suck eggs, I would find it
very inconvenient to do most of the above. <g>

I can see that. Has Google Chrome taken away the back button too?
But I liked your last paragraph's warning. That is what really needs
stressing.

I forget that some people have to pay for their bandwidth, even when
just surfing. But, if it is possible to find a way without being
ridiculous, that
would be nice. I guess, if my page uses more bandwidth than what's
normal, it would be appropriate to mark it.

Would it help if my domain name ended with a warning like "no"?
 
D

dorayme

"Roy A. said:
Would it help if my domain name ended with a warning like "no"?

I have no idea about your domain? Have I had any trouble with it? I get
on very well with most domains. I'm sure I would have little trouble
with yours, you seem a sensible fellow... Stop worrying so much. <g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top