| | |
How to vertically center your page's content in FF and IE.
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
I have a whole website that I am required to convert from IE to FF in working order.
Problem #1:
Vertically aligning the html tables so the page's content is centered within the page.
Thanks for the help in advance, Regards X.
PS: im using
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Problem #1:
Vertically aligning the html tables so the page's content is centered within the page.
Thanks for the help in advance, Regards X.
PS: im using
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Last edited by OmniX; Apr 13th, 2008 at 8:36 am.
•
•
Join Date: Feb 2005
Posts: 427
Reputation:
Solved Threads: 12
Not wanting to sound funny... but we could do with a little more detail.
Okay, so you want to vertically align it...
what size is it?
Is it a fixed height or will it vary?
Can you not supply a link to the IE version of it?
(By the way, do you mean "I have a whole website that I am required to change so it works in FF as wel las IE" ???)
Okay, so you want to vertically align it...
what size is it?
Is it a fixed height or will it vary?
Can you not supply a link to the IE version of it?
(By the way, do you mean "I have a whole website that I am required to change so it works in FF as wel las IE" ???)
Sometimes life holds wonderful suprises - shame I sleep through them all.
http://www.choose-easyweb.com - Not my design, nor my idea :)
http://www.choose-easyweb.com - Not my design, nor my idea :)
Sorry half asleep last night when I wrote it.
(By the way, do you mean "I have a whole website that I am required to change so it works in FF as well as IE" ???) yes
It is everything in general all the pages are all left aligned in FF and in IE they are centered.
What i mean by this all the content in the page is either top left aligned or middle left aligned with ALL content no matter what it is when it is presented in FF but in IE it is middle middle (middle of the page vertically and horizontally - thats how I want all my pages in FF to be done).
I am using CSS and I would like a solution prefably just using a few simple css commands.
I have been searching the internet and they say to but 3 css tags within each other, I really do not plan on doing this as its alot of extra code for nothing.
Thanks, Regards X
(By the way, do you mean "I have a whole website that I am required to change so it works in FF as well as IE" ???) yes
It is everything in general all the pages are all left aligned in FF and in IE they are centered.
What i mean by this all the content in the page is either top left aligned or middle left aligned with ALL content no matter what it is when it is presented in FF but in IE it is middle middle (middle of the page vertically and horizontally - thats how I want all my pages in FF to be done).
I am using CSS and I would like a solution prefably just using a few simple css commands.
I have been searching the internet and they say to but 3 css tags within each other, I really do not plan on doing this as its alot of extra code for nothing.
Thanks, Regards X
•
•
Join Date: Feb 2005
Posts: 427
Reputation:
Solved Threads: 12
You have little choice.
Vertical alignment isn't really something that can be easily done.
If the pages are 'tall' or 'long' (ie. they won't fit in the viewport and you have to scroll), then you could apply padding or margin to an outer container.
If the pages area fixed height (say 400px or someting), then it can be done... usually by trickery (suchas positioning it down by 50%, then pulling it up by 25%)... but this can get a little out of shape in some browsers (some don't like negative margins, others don't like applying padding/margins to the bottom if certain styles are applied etc.).
Can you supply a URL?
(If you don't want to list your real one, pop over to tinyurl.com and get a 'fake' one for the time being
)
Vertical alignment isn't really something that can be easily done.
If the pages are 'tall' or 'long' (ie. they won't fit in the viewport and you have to scroll), then you could apply padding or margin to an outer container.
If the pages area fixed height (say 400px or someting), then it can be done... usually by trickery (suchas positioning it down by 50%, then pulling it up by 25%)... but this can get a little out of shape in some browsers (some don't like negative margins, others don't like applying padding/margins to the bottom if certain styles are applied etc.).
Can you supply a URL?
(If you don't want to list your real one, pop over to tinyurl.com and get a 'fake' one for the time being
) Sometimes life holds wonderful suprises - shame I sleep through them all.
http://www.choose-easyweb.com - Not my design, nor my idea :)
http://www.choose-easyweb.com - Not my design, nor my idea :)
Its not that im worried its that i dont have one, its on localhost apache
(nice link though)
I have searched the internet and this seems to be a problem always cropping up.
Because the website was working fine but now that I also need to make it FF compliant its being a real pain. I googled and the usually scenario is "my table is centered in IE but in FF it is left aligned".
Well can you tell me your best suggestion on what to do (to get my table centered vertically/horzontially)?
Thanks Regards, X
(nice link though)I have searched the internet and this seems to be a problem always cropping up.
Because the website was working fine but now that I also need to make it FF compliant its being a real pain. I googled and the usually scenario is "my table is centered in IE but in FF it is left aligned".
Well can you tell me your best suggestion on what to do (to get my table centered vertically/horzontially)?
Thanks Regards, X
If you have a common style sheet that's used throughout the site, it's not hard to center your pages. Absolute position the body. Add the following attributes to the body: You'll have to play around with the left amount until things look like you want them to. I used a percentage instead of a fixed amount because of the wide variety of monitor resolutions used these days. The top is optional but, you may find that you'd like a little more or less space from the top than what the browser gives by default.
Hope this helps.
css Syntax (Toggle Plain Text)
body{ position:absolute; left:25%; top:5px; }
Hope this helps.
•
•
Join Date: Feb 2005
Posts: 427
Reputation:
Solved Threads: 12
Well, is the table a fixed width?
Or if percentile, how much of a gap is left?
Dare I say it... you could paste it all in here
(last resort).
I'll grab a copy and work it over.
Or if percentile, how much of a gap is left?
Dare I say it... you could paste it all in here
(last resort).
I'll grab a copy and work it over.
Sometimes life holds wonderful suprises - shame I sleep through them all.
http://www.choose-easyweb.com - Not my design, nor my idea :)
http://www.choose-easyweb.com - Not my design, nor my idea :)
Its nothing special really.
You can make an example and post it here?
My code is simple at the moment:
There is my code now very simple really.
But I cannot get it to be "DEAD CENTER" in both FF and IE. At the moment best I have come up with is "DEAD CENTER" in FF using the container method (not very nice but usable
).
I would like a solution which works on different page sizes as I change frequently from frames(30% of my page height) to no frames.
Hope that helps, Regards X
You can make an example and post it here?
My code is simple at the moment:
HTML and CSS Syntax (Toggle Plain Text)
<table> <tr> <td> 1 Heading </td> </tr> <tr> <td> 2 PHP Code </td> </tr> <tr> <td> 3 PHP Code </td> </tr> </table>
There is my code now very simple really.
But I cannot get it to be "DEAD CENTER" in both FF and IE. At the moment best I have come up with is "DEAD CENTER" in FF using the container method (not very nice but usable
).I would like a solution which works on different page sizes as I change frequently from frames(30% of my page height) to no frames.
Hope that helps, Regards X
•
•
Join Date: Feb 2005
Posts: 427
Reputation:
Solved Threads: 12
Okay... not wanting to come across as critivcal... but does this have to be tables?
You have 3 content zones... and not more than 1 item per row?
That would be 3 divs... thats it!
Maybe 1 outer wrapper if you like... 4 divs... thats 8 lines (open/close) - compared to the Tables 14?
Still, ignoring that... what styling have you tried to apply to the table?
Have you tried...
???
Or applied an outer div and done it to that (along with text-align: center
???
Give those a try.
You have 3 content zones... and not more than 1 item per row?
That would be 3 divs... thats it!
Maybe 1 outer wrapper if you like... 4 divs... thats 8 lines (open/close) - compared to the Tables 14?
Still, ignoring that... what styling have you tried to apply to the table?
Have you tried...
HTML and CSS Syntax (Toggle Plain Text)
<table style="width: 600px; margin: 0 auto;">
Or applied an outer div and done it to that (along with text-align: center
???Give those a try.
Sometimes life holds wonderful suprises - shame I sleep through them all.
http://www.choose-easyweb.com - Not my design, nor my idea :)
http://www.choose-easyweb.com - Not my design, nor my idea :)
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: horizontal divs
- Next Thread: alternative to iframes
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl





