Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help 

Need Help Centering/Scaling My Website!

Hey Guys, Im new to html and css so sorry if I use bad terms and stuff. But anyways let me explain my problem. I have this website that I coded (Very poorly because im new) and when im on Google Chrome at 100% zoom the website kinda looks centered and that's all good. But when you zoom out or in, the text and button goes off in one direction when I want it to roughly stay in the middle. So here's my code, please ignore what the website is about because it's for a who is a lot younger than me :P

HTML (The html is extremely messy, yes I know, I'm only a beginner so please excuse that and there even might be stuff in their I don't need, but the html code works how I want so ye :P!)
<html>
<head>
<title>Exodian_22_3</title>
<style>
div.text {
position: fixed;
bottom: 500;margin:0 auto;
right: 0;margin:0 auto;
width: 1960px;margin:0 auto;

}
div.button {
position: fixed;
bottom: 445;
right: 0;margin:0 auto;
width: 1965px;margin:0 auto;
color: #2EFE2E;

}
</style>
<audio autoplay>
<source src="audi2o.ogg" type="audio/ogg">
<source src="audi2o.mp3" type="audio/mpeg">
</audio>
</head>

<body>
<body bgColor="Black">
<center>
<div class="text">
<font face="calibri light"><font color="white" size="6"><b>--= Exodian 22 =--</b>
<font face="calibri light"><font color="white" size="4"><br>Welcome, We are wanting Problem Solvers from around the Globe,<br>Complete this simple test and we will Let you have
the choice<br>to be invited to our organization.
</div>
<div class="button"
<form>
<form action="Password_1.php">
<input type="submit" value="ENTER" style="font-size:1.1em; color:#FFFFFF;background-color:#071907;">

</form>
</div>

</center>

</body>

So when you save that as a .html, a button and text comes up with a black ground. I want that text and button to be centered and even if you zoomed out it would roughly be in the center. If someone could give me some code and show me where to put it, or just edit what I just gave you that would be awesome :D

Thanks!
Code tags are your friend.

Code
text-align: center;

Add that attribute to the CSS of your body and your text nodes and input elements should be centered.

Also, don't make your shit 1960 pixels wide.


I used to eat poop. I still do, but I used to.
I don't really get what you are saying, can you maybe supply you html? sorry Im new :S
Probably set up the html as index.html and then make a css folder and add a style.css and then
type in your html file under </head>

<link rel="stylesheet" href="css/style.css">

To get a better looking and it will be easier to setup things.

And in the style.css is where you are going to import your css. 😁
(Jul 30, 2015 08:45 AM)MidnightWolf Wrote:  Probably set up the html as index.html and then make a css folder and add a style.css and then
type in your html file under </head>

<link rel="stylesheet" href="css/style.css">

To get a better looking and it will be easier to setup things.

And in the style.css is where you are going to import your css. 😁

Did you even read the original post? Because you did absolutely nothing to answer his question.

OP: Remove the styles that set width to 1960 pixels and add a style tag to your body that gives the "text-align: center" property.


I used to eat poop. I still do, but I used to.
Hey Guys, Thanks for the responses it really helped me out, I did what you said and it worked, and I just looked at another websites source code to find out how they did it with css and showed me a couple of things i didn't know. So now it's centered and working so thank you guys, I have really been needing this for ages :D


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Help] by RarinatorAug 23, 2014 07:36 PM 3 97 Aug 23, 2014 07:36 PM
Last Post: Knar.
[Help] by Drizzy‎‎Jun 9, 2014 09:38 AM 6 139 Jun 9, 2014 09:38 AM
Last Post: SirBuck777
by PerniciousDec 10, 2012 10:39 AM 2 91 Dec 10, 2012 10:39 AM
Last Post: rswinges