Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Web Design Lobby Forum for general web design issues not specific to scripting or graphics.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 06-28-2008, 07:01 PM   #1 (permalink)
Contributing Member
 
Join Date: 06-04-08
Location: Greenwich, CT
Posts: 152
iTrader: 0 / 0%
Latest Blog:
None

jtaporco is just really nicejtaporco is just really nicejtaporco is just really nicejtaporco is just really nicejtaporco is just really nicejtaporco is just really nicejtaporco is just really nicejtaporco is just really nicejtaporco is just really nicejtaporco is just really nice
image in center horizontally and vertically

if i wanted to center an image dead center in the browser horizontally and vertically how would i do that in css. i tried w3 but i couldnt find anything there or google.

Thanks!
__________________
jtaporco
jtaporco is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-10-2008, 05:07 AM   #2 (permalink)
Contributing Member
 
Join Date: 07-03-08
Posts: 56
iTrader: 4 / 100%
Latest Blog:
None

pallmathu is liked by many
hi i dont know these thigns but i think i can guess.

use both CSS and Javascript

find browser window size (width and height)in page load event

image_display_hpixel=(browser width -image width)/2
similarly height
then set the off set of image u get from above calculation

once again i am not a coder or a designer but been with some so tring to make a guess

let me know if it works
pallmathu is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-10-2008, 02:13 PM   #3 (permalink)
Contributing Member
 
deceylon's Avatar
 
Join Date: 04-11-08
Location: SriLanka
Posts: 161
iTrader: 0 / 0%
deceylon is liked by many
I think no need of Jscripts,
You can done it with CSS.
__________________
The Lanka Reporter : Srilanka NEWS analyst
Cyber Realm Free Demonoid codes
deceylon is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-13-2008, 09:10 PM   #4 (permalink)
Junior Member
 
Join Date: 06-26-08
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

seolady is liked by many
yes, you could do that in css. try this for code:

Code:
.dead_center_class{ position: absolute; top: 50%; left: 50%; }
the name for the class (in red) is just an example you can change it. And i havent used the "%" yet but i think its valid, based from w3schools here, you can try their example at:
http://www.w3schools.com/css/tryit.a...on_top_percent
__________________
Home Based Business Books.com
seolady is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-14-2008, 12:04 AM   #5 (permalink)
Contributing Member
 
deceylon's Avatar
 
Join Date: 04-11-08
Location: SriLanka
Posts: 161
iTrader: 0 / 0%
deceylon is liked by many
Yes w3schools has good tutorials.
their forum also very important.
__________________
The Lanka Reporter : Srilanka NEWS analyst
Cyber Realm Free Demonoid codes
deceylon is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-18-2008, 02:16 PM   #6 (permalink)
Contributing Member
 
webcosmo's Avatar
 
Join Date: 03-17-07
Location: Boston, MA
Posts: 1,302
iTrader: 5 / 100%
webcosmo is a jewel in the roughwebcosmo is a jewel in the roughwebcosmo is a jewel in the roughwebcosmo is a jewel in the roughwebcosmo is a jewel in the roughwebcosmo is a jewel in the roughwebcosmo is a jewel in the rough
One thing you have to do is for the body css use 100% height. Without doing that browsers have flow height by default.

The for positioning I think you can use the css mentioned above
.dead_center_class{
position: absolute;
top: 50%;
left: 50%;

}
__________________
WEBMASTER FORUM * CONTESTS * REVENUE SHARING
Join the fun loving, helpful community of webmasters

Free Classified Ads
webcosmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-01-2008, 04:43 PM   #7 (permalink)
Contributing Member
 
Join Date: 07-10-08
Posts: 59
iTrader: 0 / 0%
Latest Blog:
None

PixelPerfectDesigner is liked by many
Quote:
Originally Posted by seolady View Post
yes, you could do that in css. try this for code:

Code:
.dead_center_class{ position: absolute; top: 50%; left: 50%; }
the name for the class (in red) is just an example you can change it. And i havent used the "%" yet but i think its valid, based from w3schools here, you can try their example at:
http://www.w3schools.com/css/tryit.a...on_top_percent
This block of code alone won't work! It will put the top left corner of the image in center but not the image in center!
PixelPerfectDesigner is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-01-2008, 05:07 PM   #8 (permalink)
The McLickerator
 
3ncryptabl3_lick's Avatar
 
Join Date: 05-31-04
Location: Where do any of us *really* live, I ask you?
Posts: 3,807
iTrader: 6 / 100%
3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order3ncryptabl3_lick is a web professional of the highest order
This is what I have, placed before the </head> to center my flash site vertically and horizontally in the body:

Code:
</script> <style type="text/css"> <!-- html,body { margin: 0; padding: 0; } table { width: 100%; height: 100%; } td { align: center; vertical-align: middle; } div.container { position: relative; margin-left: auto; margin-right: auto; width: 870px; height: 600px; } --> </style>
But I didn't write it, my coder did so I can't support you if it doesn't work for you. Also, you'll have to change the width:870px and height: 600px to match the width and height of your image.
__________________
"Y'all mind hanging back? You're jamming my frequency." OpticalDevotee
3ncryptabl3_lick is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-14-2008, 10:43 PM   #9 (permalink)
Contributing Member
 
water2filter's Avatar
 
Join Date: 01-21-08
Location: China
Posts: 131
iTrader: 0 / 0%
Latest Blog:
water filter

water2filter is an unknown quantity at this point
Send a message via MSN to water2filter
It is better to control by CSS. however if you donot understand CSS, you can do by table.
water2filter is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to center an image in CSS? Ryodlog Coding Forum 4 07-12-2008 08:46 AM
How do you center a web page? factoring Coding Forum 10 06-16-2007 07:29 AM
Vertically centered template superivan Web Design Lobby 8 02-05-2007 01:02 AM
Data center 64.233.161.99 POR-15 Depot Google Forum 31 02-16-2004 07:14 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 08:58 AM.
© Copyright 2008 V7 Inc