CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 21st, 2004, 08:37 PM
rs. rs. is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 rs. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 54 sec
Reputation Power: 0
Absolute center

I've only just started mucking round with CSS. Just by looking at other peoples sites and seeing how they do something, and then mucking around with what they've written to learn it.

What I am trying to do at the moment, is just have a blank page with at the absolute center (Vertical and Horizontal) of the screen have some text. But the text is only horizontally centered not vertically.

Heres the codes:
In seperate stylesheet
Code:
#center {
	position: absolute
	width: 100%;
	height: 100%;
	text-align: center;
	vertical-align: middle;
}


and in the page

Code:
<div id="center">
      <p><span class="aus">Austrlia</span><br>
        <span class="contact">admin@sixfootone.com +61 412 587890</span>
        </p></div>

Any ideas?
Thanks

Reply With Quote
  #2  
Old July 22nd, 2004, 01:36 AM
TheJim01's Avatar
TheJim01 TheJim01 is offline
Coconuts migrate?
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: http://middle.nowhere.com
Posts: 1,894 TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)  Folding Points: 67725 Folding Title: Intermediate FolderFolding Points: 67725 Folding Title: Intermediate FolderFolding Points: 67725 Folding Title: Intermediate FolderFolding Points: 67725 Folding Title: Intermediate Folder
Time spent in forums: 2 Weeks 5 Days 10 h 4 m 38 sec
Reputation Power: 1173
Right now, vertical-align doesn't seem to be supported very much. kk5st has a demo (that I'm sure he'll share, as I forget the link) to a demo of absolute-centered pages. It is one of the few instances where tables are "recommended," because of the default vertical-align: middle property. It'll look something like this:
PHP Code:
<table style="height: 100%; width: 100%;"><tr><td style="text-align: center;">

<
div id="centered_div" style="margin-left: auot; margin-right: auto; text-align: left;">
this is the "centered" div
</div>

</
td></tr></table


I hope this helps.
__________________

Proud member of the T.S.N.B.U.F.L (tables should not be used for layout) alliance.

"Only use elements for their intended purpose. You wouldn't try to make coffee with a telephone, would you?" -Me

Reply With Quote
  #3  
Old July 22nd, 2004, 02:04 AM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,659 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 50 m 18 sec
Reputation Power: 687
Quote:
Originally Posted by TheJim01
kk5st has a demo (that I'm sure he'll share, as I forget the link) to a demo of absolute-centered pages.
I'm hurt that you don't have it bookmarked as a basic reference and hi-lited in red.

The demos are horizontal centering and vertical centering. Both are written to center a container div, but the element could just as well be a paragraph or form or any other element.

cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

My html and css workshop, demos and tutorials.
Ask a better question, get a better answer.

Reply With Quote
  #4  
Old July 22nd, 2004, 10:00 AM
rs. rs. is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 rs. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 54 sec
Reputation Power: 0
Thanks for the help.

After checking my orignal code out in Safari it works fine in that, but IE and Firefox don't want to work correctly.

Using a table as suggested now.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Absolute center


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT