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.

CSS Forum


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



Reply
Old 11-30-2009, 01:14 AM page WONT center
Skilled Talker

Posts: 67
Name: chris
Trades: 0
I tried reading all the tutorials in the sticky topic, copied them exactly.



My page isnt centering

Here is the HTML and CSS inline:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
    background-color: #000;
    text-align: center;
}

#container {
  margin: 0 auto;
  width: 960px;
  }

#networkbar {
    position:absolute;
    left:0px;
    top:0px;
    width:960px;
    height:15px;
    z-index:1;
    background-image: url(COD/images/network_bar.jpg);
}
#banner {
    position:absolute;
    left:0px;
    top:15px;
    width:960px;
    height:113px;
    z-index:2;
    background-image: url(COD/images/header.jpg);
}
#linkbar {
    position:absolute;
    left:0px;
    top:128px;
    width:960px;
    height:20px;
    z-index:3;
    background-image: url(COD/images/nav.jpg);
}

#content {
    position:absolute;
    left:0px;
    top:150px;
    width:960px;
    height:0px;
    z-index:4;
}
body,td,th {
    color: #FFF;
}

-->
</style>
</head>

<body>
<div id="container">
<div id="content">Hello Welcome to my website. I am trying to center my text but its not worknig and im extreme mad now. So i will continue to try and hopefuly it will work. Most likley not because god hates me. but its all good. </div>


<div id="networkbar"></div>
<div id="banner"></div>
<div id="linkbar">dsfdsfsd</div>
</div>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

WIN 3 months of advertising on tech4talk! Just make 15 posts!
boxiom is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-30-2009, 01:40 AM Re: page WONT center
Skilled Talker

Posts: 58
Trades: 0
Code:
#container {
  margin: 0 auto;
  width: 960px;
  position:relative
  }
whatsherface_21 is offline
Reply With Quote
View Public Profile
 
Old 12-03-2009, 10:25 AM Re: page WONT center
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
An even better solution would to just get rid of all the unnecessary absolute positioning, you're just asking for trouble, especially with IE.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-03-2009, 01:14 PM Re: page WONT center
Experienced Talker

Posts: 35
Name: Matthew Cook
Trades: 0
I agree with the poster above get rid of all absolute positioning. There is a very helpful tutorial about this on webdesignerwall that I was looking at earlier. I don't know if I can post a link?
__________________

Please login or register to view this content. Registration is FREE
- Fastest growing Winnipeg website design company
mcook is offline
Reply With Quote
View Public Profile
 
Old 12-03-2009, 03:35 PM Re: page WONT center
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Sure, post the link to Web Designer Wall.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-03-2009, 06:31 PM Re: page WONT center
Extreme Talker

Posts: 202
Location: Toronto
Trades: 0
install firebug for FF.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
HostLead is offline
Reply With Quote
View Public Profile Visit HostLead's homepage!
 
Old 12-03-2009, 07:16 PM Re: page WONT center
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
If your still having a problem, try this:
Quote:
<div align="center">Your text here</div>
or see this page:

http://www.w3schools.com/css/css_positioning.asp

To add it to your css, it's not hard at all.
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 12-03-2009 at 07:19 PM..
Brian07002 is online now
Reply With Quote
View Public Profile
 
Old 12-04-2009, 05:57 AM Re: page WONT center
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Do NOT use the align attribute
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-04-2009, 02:07 PM Re: page WONT center
Skilled Talker

Posts: 79
Location: Devon, England
Trades: 0
Get rid of the absolute positioning. A block with absoulte positions will ignore it's container block.
__________________
Please add to my Talkupation if I was helpful. Thanks.


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
paaaaaaaaaa is offline
Reply With Quote
View Public Profile Visit paaaaaaaaaa's homepage!
 
Old 12-04-2009, 03:53 PM Re: page WONT center
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
A block with absoulte positions will ignore it's container block
Not entirely true. If the container is set to position:relative, the absolutes will be placed relative to that container.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to page WONT center
 

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 0.39408 seconds with 12 queries