forums Computer Tutorials Computer Help and Spyware Removal File DatabaseUninstall Database Windows Startup Programs Database Computer Resources Computer Glossary Forums Computer Help and Spyware Removal
 

Welcome Guest ( Log In | Click here to Register a free account now! )



Register a free account to unlock additional features at BleepingComputer.com
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

 
Reply to this topicStart new topic
> Html Problem
Sc00by22
post May 16 2008, 10:49 AM
Post #1


Member
**

Group: Members
Posts: 129
Joined: 31-May 07
From: England
Member No.: 133,904



I have been designing a website for my game company but it seems it doesn't seem to center my layer, I have tried everything, Here is a picture of what it looks like, For some reason it works on my pc on Firefox and IE, But on any PC it comes up like this. I want the middle section to be centered, Which it is in Frontpage and on my PC but on any other it seems to be on the left hand side



Here is the HTML code

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>Good-Games.co.uk</title>
<style type="text/css">
.style1 {
    text-align: left;
}
.style3 {
    font-family: "Berlin Sans FB";
    text-align: center;
}
a {
    color: #A9ACAE;
}
a:visited {
    color: #A9ACAE;
}
a:active {
    color: #A9ACAE;
}
a:hover {
    color: #A9ACAE;
}
.style4 {
    border-width: 0;
    vertical-align: top;
}
.style5 {
    text-align: center;
}
</style>
</head>

<body style="background-color: #A9ACAE">

<p class="style5">
<map name="FPMap0" id="FPMap0">
<area href="index.html" shape="rect" coords="59, 90, 93, 101" />
<area href="http://good-games.co.uk/forums/index.php" shape="rect" coords="160, 90, 201, 100" />
</map>
<img alt="Menu" src="image/menu.jpg" usemap="#FPMap0" class="style4" /></p>

<div style="position: absolute; width: 777px; height: 800px; z-index: 1; left: 115px; top: 141px" id="layer1" class="style5">
    <img alt="Top" src="image/sidebar_top.jpg" width="777" height="10" /><br />
    <img alt="Right" src="image/sidebar_right.jpg" width="10" height="800" style="float: right" /><div class="style1">
    </div>
    <img alt="Left" src="image/sidebar_left.jpg" width="10" height="800" style="float: left" /><div class="style1">
    </div>
    <div style="position: absolute; width: 750px; height: 794px; z-index: 1; left: 13px; top: 13px" id="layer2" class="style3">
We are a revolutionized gaming company, Who want to bring great games to the
thousands. Our first game will be an MMORPG(Massively multiplayer online
role-playing game) and it will be set in the Medieval Times, It will be called
&quot;The Hidden Elements&quot;. It will include Free Play and Member Play. We will have
many classes, races and Jobs. The game will be a player driven economy</div>
    <img alt="Bottom" src="image/sidebar_bottom.jpg" width="777" height="10" /></div>

</body>

</html>
Go to the top of the page
 
+Quote Post
groovicus
post May 16 2008, 11:35 AM
Post #2


Hail Groovicus!
******

Group: Site Admin
Posts: 5,673
Joined: 5-June 04
From: Vermillion, SD
Member No.: 689



That is because you are using absolute positioning. That means no matter what, it is going to position itself right where you tell it, and it will never move. You need to either figure out how much offset you need in order to center it on your screen (the wrong way), or remove the absolute positioning element and use css to center the div (the right way). If you use CSS to center the div, then no matter the screen width, it will always be centered.

HINT: margin:0 auto;


--------------------
Go to the top of the page
 
+Quote Post
TheoSqua
post Jun 4 2008, 04:53 PM
Post #3


Member
**

Group: Members
Posts: 19
Joined: 17-May 08
Member No.: 209,542



doing margin-left: auto and margin-right: auto on that div should center it in firefox, putting in a text-align:center will get IE centered.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 6th July 2008 - 09:30 AM


Advertise   |   About Us   |   Terms of Use   |   Privacy Policy   |   Contact Us   |   Site Map   |   Chat   |   Tutorials   |   Uninstall List
Discussion Forums   |   The Computer Glossary   |   Resources   |   RSS Feeds   |   Startups   |   The File Database   |   Malware Removal Guides

© 2003-2008 All Rights Reserved Bleeping Computer LLC.