Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 10-04-2005, 08:08 PM centering webpage
Skilled Talker

Posts: 83
Trades: 0
I am having problems centering my webpage.

When I center my page, all the divs are not inside the container.

What I did was to make a div that was a contained, and then put all other divs inside that one, but the centering does not happen.

Anyone know how I can fix this


thanks


http://www.egressglo.com/test2/index.html
scorch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-04-2005, 08:32 PM
praveen's Avatar
Life is a Dream

Posts: 3,591
Name: Praveen
Location: Chennai, India
Trades: 0
specify a width for the main div (container) and then set the margin left and right to auto.

and it should be centered on ur browser.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
praveen is offline
Reply With Quote
View Public Profile
 
Old 10-05-2005, 03:06 PM
Skilled Talker

Posts: 83
Trades: 0
I managed to center the main container, but all other divs are static and stay in place. So when I resize the screen they leave the container.

Are there any files or webpages I can download so I can see how it has been done? I have done it before, but for some reason I cannot get it now.
scorch is offline
Reply With Quote
View Public Profile
 
Old 10-05-2005, 03:17 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
The DIVs must be inside the container centered div and absolute positioned to move with it:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<title>Untitled Page</title>
		<style type="text/css" media="screen"><!--
#Container  {
	background-color: #ddd;
	visibility: visible;
	margin-right: auto;
	margin-left: auto;
	padding-top: 100px;
	position: relative;
	width: 700px
	}

#AbsoluteBox  {
	color: #fff;
	background-color: #bf0000;
	visibility: visible;
	position: absolute;
	top: 5px;
	left: 25px;
	width: 100px;
	height: 100px
	}


--></style>
	</head>

	<body bgcolor="#ffffff">
		<div id="Container">
			<div id="AbsoluteBox">
				Box
			</div>
			<p>Knight Rider, a shadowy fight into the dangerous world of a man who does not exist. Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless in a world of criminals who operate above the law.</p>
			<p>Ulysses, Ulysses - Soaring through all the galaxies. In search of Earth, flying in to the night. Ulysses, Ulysses - Fighting evil and tyranny, with all his power, and with all of his might. Ulysses - no-one else can do the things you do. Ulysses - like a bolt of thunder from the blue. Ulysses - always fighting all the evil forces bringing peace and justice to all.</p>
			<p>Just the good ol' boys, never meanin' no harm. Beats all you've ever saw, been in trouble with the law since the day they was born. Straight'nin' the curve, flat'nin' the hills. Someday the mountain might get 'em, but the law never will. Makin' their way, the only way they know how, that's just a little bit more than the law will allow. Just good ol' boys, wouldn't change if they could, fightin' the system like a true modern day Robin Hood.</p>
		</div>
		<p></p>
	</body>

</html>
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 10-05-2005, 03:57 PM
Skilled Talker

Posts: 96
Name: Tudor Barbu
Trades: 0
With "absolute" positioning, the divs will always stay in place. That's what absolute does. In your case, use "relative".
__________________

Please login or register to view this content. Registration is FREE
Tudor.b is offline
Reply With Quote
View Public Profile Visit Tudor.b's homepage!
 
Old 10-06-2005, 01:13 AM
Skilled Talker

Posts: 83
Trades: 0
THanks for the help guys.

Ive gotten it sort of work with internet explorer, but when im mozilla firefox the container divs stays centered, but all the other divs move.

check it out

http://www.egressglo.com/test2/works.htm

Not sure why im having so many problems, im using dreamweaver. When I move the divs around, they dont match what I see on the browser. So I have to move them to some extreme corners in order to put them where they should be.
scorch is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to centering webpage
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.28556 seconds with 12 queries