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 June 13th, 2004, 04:14 PM
versionsix versionsix is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 28 versionsix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
centering? or uhm....

How can I, let's see how to say this. Align text to the middle of a div (up and down)... not really a center


Normal:

________________________________
Text

________________________________



After:
________________________________

text
________________________________



THANKS

Reply With Quote
  #2  
Old June 14th, 2004, 01:05 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 27
__________________
- Andreas Koepke

Koepke Photography


Reply With Quote
  #3  
Old June 14th, 2004, 03:58 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,672 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 14 h 56 m 21 sec
Reputation Power: 687
As much as I dislike tables for layout, vertical centering is one area that has no CSS equivalent.
Code:
 <div style="position: relative; width: 200px; height: 200px;">
      <table style="height: 100%;">
        <tr>
          <td>
            <p>Now is the time for all good men to come to the aid of
            their country.</p>
          </td>
        </tr>
      </table>
    </div>
This uses the default td attribute "valign='middle'" I've used this method to center pages in the viewport.

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 June 14th, 2004, 04:03 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Jul 2003
Location: I used to live at home, now I stay at the house
Posts: 9,920 ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 3 Months 2 Weeks 6 Days 7 h 7 m 42 sec
Reputation Power: 873
Facebook
Well, I looked into the method in Andreas's link, but I just can't seem to get it to do anything like what it's meant to, so I agree with Gary, tables are the only way to achieve what you're after...
__________________
Support requests via PM will be ignored!
Sites: Route of Queue | Sinthetic - Alternative UK Hiphop
Read These: The General Rules Thread | The General FAQ Thread | NEW USERS - How to post a question

Sign up with Matched.co.uk and earn up to £15 per website every month!


Reply With Quote
  #5  
Old June 14th, 2004, 10:06 AM
stinkoman's Avatar
stinkoman stinkoman is offline
what's your moniker?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Highland Park, NJ
Posts: 201 stinkoman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to stinkoman
Quote:
Originally Posted by ChiefWigs1982
Well, I looked into the method in Andreas's link, but I just can't seem to get it to do anything like what it's meant to, so I agree with Gary, tables are the only way to achieve what you're after...

It depends what the container is. Some block level elements don't position horizontally. (I'm sure there's a list somewhere) You could always use margin/padding too.

-Greg
__________________
new jersey web design

Reply With Quote
  #6  
Old June 14th, 2004, 11:38 AM
versionsix versionsix is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 28 versionsix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have learned to not use margin and padding and stuff like that... It isn't cross browser at all, firefox has one hell of a time with it. Besides, IE doesn't view the web as it is suppose to be viewed, so yea...

I'll try what was suggested about the div aligning, thanks!

-Trying to stick without tables

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > centering? or uhm....


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 1 hosted by Hostway
Stay green...Green IT