SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
May 14, 2002, 07:54 #1
- Join Date
- Jan 2002
- Location
- smelly armpit of Asia
- Posts
- 305
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
need help with table-less design with DIVs
I'm trying to get an image to center vertically but not shift horizontally at all. It's a vertically aligned name of a site (sorry, no URL yet) and I just need it to stretch to the center of the page vertically at higher resolutions but keep its horizontal position. Any ideas on how to do this?
-
May 14, 2002, 11:44 #2
- Join Date
- Apr 2002
- Posts
- 75
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
goma,
Go on over to http://www.bluerobot.com and take a look at their 2 CSS Centering techniques. I think this will answer your question.
Shoop
-
May 20, 2002, 20:04 #3
Use a positioned div (top:10px), and align=center. Should do the trick.
-
May 22, 2002, 10:52 #4Use a positioned div (top:10px), and align=center. Should do the trick.
How can that do the trick ?
He wants to align his image/text vertical and with the code you provide it aligns 10px under the top of the page) and in the horizontal middle.
-
May 22, 2002, 10:55 #5
splash-screen ?
Goma do you wanna use this for a splashscreen ?
Ofcourse it's depending on what kind of site you are making ( IE personal or commercial ) and personal preference but if it's for a commercial website splashscreens are a no-no.
-
May 22, 2002, 11:00 #6
- Join Date
- Jun 2001
- Location
- outside my mind
- Posts
- 900
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm assuming your using a class for this image called "verticle" and it is aligned with the body of the page. Verticle is a lot more tricky than horizontal positioning but this might work, but I think it's as easy as defining a top margin or position.
Code:.verticle { position: absolute; ( or relative ) top: 50% ( this should do it ) margin: 0px auto; } or .verticle { margin: 50% auto; }
-
May 22, 2002, 15:24 #7
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just to add to what Spider wrote. This will not result in the image being positioned EXACTLY in the middle. It will position the top of the DIV to the middle of the page. This may or may not be what you're looking to do.
If it doesn't look right, play with the percentages until you've got it like you want it.Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
May 22, 2002, 15:42 #8
- Join Date
- Jun 2001
- Location
- outside my mind
- Posts
- 900
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That's a nice tip...
Thanks Creole
Bookmarks