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 11th, 2003, 09:13 PM
ctstone's Avatar
ctstone ctstone is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 147 ctstone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
The forums went down right after I posted this. Here's the original message:

I'm trying to get a bit of text in a <span> to sit at the bottom of a <div>. I've tried setting the vertical-align to 'bottom' and 'text-bottom' but it won't budge.

View source of this page for example

I'm trying to get the part that says 'this should be aligned to the bottom' to shift down so it's flush with the top of the menu.

Any ides? I'm trying to create a page without tables, using only CSS positioning.
__________________
ctnstone.com

Reply With Quote
  #2  
Old July 11th, 2003, 10:19 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,299 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 1 h 54 m 17 sec
Reputation Power: 760
Specify the height of the <div> that contains that text, then place that text in another <div> and give it a top margin enough to send it to the bottom of the container <div>. You may also be able to give the <span> that margin (or padding) instead, not sure there.

Reply With Quote
  #3  
Old July 12th, 2003, 01:46 AM
OldJacques's Avatar
OldJacques OldJacques is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: in Orbit mostly
Posts: 148 OldJacques User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I don't think you want to play with fixed margin heights, as that would be tying you into the rendering engine and fixed heights again.
I think the underlying problem is the fact that from what I've read and tried, the "vertical-align" is tied to the line-height, which by default follows the text-size.
I was able to do what you want by inserting
Code:
div.header
{
  line-height:33px;
  margin: 5px;
  vertical-align: text-bottom;
}

it seems that the 33 is the minimum (28 largest character + 5 top margin).

And it will never be FLUSH with the top of the menus if you have the 5 px margin, of course, but you will have a constant border which is the same under "this should be aligned to the bottom" as it is under "SUBTITLE".

Last edited by OldJacques : July 12th, 2003 at 01:48 AM.

Reply With Quote
  #4  
Old July 13th, 2003, 01:12 AM
ctstone's Avatar
ctstone ctstone is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 147 ctstone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thanks for the help. I couldn't get the line-height method working, but I got what I wanted by changing the <span>s to <div>s and just pushing it to the bottom by setting margin-top.

Now I have a new CSS positioning problem. Ironically, now that I want an element to go to the middle, it won't do it.

click here for example

I'm trying to get that center section to span the distance between the two side menus (with a bit of padding between them). Any ideas? I can get it to look 'ok' for a single resolution by setting width: xx% but it's only exactly centered for that resolution. This is driving me nuts! I may have to go back to tables.

Reply With Quote
  #5  
Old July 13th, 2003, 03:08 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,541 kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 1 h 27 m 15 sec
Reputation Power: 597
Back to your first problem, what you want is something like this;
Code:
span.left 
       {float: left;
	font-size: 15px;
	vertical-align: text-bottom;
        position: relative;
        top: 25px;}


For your second problem, try this site. If it's not the answer, it'll point you in the right direction.

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.

Ask a better question, get a better answer.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS and vertical alignment


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 6 hosted by Hostway