...

View Full Version : How do i make the content float in the middle?



Shades
12-10-2005, 01:31 AM
I know I messed the title up but here is an example of what i mean.
http://www.templatesfreelance.com/preview_temp.php?x=105&y=36&idtem=39

I don't wanna make a site like that I have just forgotten how do that, and if someone could tell me or give me a code that would be great thanks in advance.

-Shades, Admin.

_Aerospace_Eng_
12-10-2005, 03:39 AM
Are you asking how to center a site?

Shades
12-10-2005, 05:40 AM
There thats a better way of putting it, thank you, and yes I guess thats what I'm asking, and if u could shed some light on this I would be most grateful.

-Shades,

liorean
12-10-2005, 05:42 AM
Not really a JavaScript question. Over to the HTML&CSS forum.

Shades
12-10-2005, 05:48 AM
Sorry

_Aerospace_Eng_
12-10-2005, 05:49 AM
There thats a better way of putting it, thank you, and yes I guess thats what I'm asking, and if u could shed some light on this I would be most grateful.

-Shades,
Well the ideal way would be to use the CSS property margin:auto;, here is a little example.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Centering using CSS property margin:auto</title>
<style type="text/css">
html, body {
margin:0;
padding:0;
background:#CCC;
color:#FFF;
text-align:center;
}
#container1 {
width:780px;
height:300px;
margin:10px auto;
background:#F00;
color:#000;
border:1px solid #000;
}
#container2 {
width:600px;
height:300px;
margin:10px auto;
background:#00F;
color:#000;
border:1px solid #000;
}
#container2 td {
vertical-align:top;
}
</style>
</head>

<body>
<div id="container1">Content</div>
<table id="container2" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Content</td>
</tr>
</table>
</body>
</html>

glish_dreams
12-10-2005, 05:59 AM
this works in every browser right

_Aerospace_Eng_
12-10-2005, 06:18 AM
this works in every browser right
Yeah as long as you have this part

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

It will work in the latest browsers.

Shades
12-10-2005, 06:25 AM
Yes thank you thats helpful and all but it still doesn't center it....or am I missing something?

_Aerospace_Eng_
12-10-2005, 06:29 AM
I have no idea what your code looks like. Post your code or a link to your site.

glish_dreams
12-10-2005, 08:57 AM
Yeah as long as you have this part

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
It will work in the latest browsers.



yea i noticed that line of code alot today.. and even FrontPage03 has it in the saved most used codes

wtf does it mean and do...?

_Aerospace_Eng_
12-10-2005, 09:02 AM
It tells the browser how to handle the code and where to get the coding rules for the document. Here is a list (http://www.w3schools.com/tags/tag_doctype.asp) of possible doctypes. The strict doctypes tend to make browsers display code a bit better.

FLCC
12-10-2005, 10:39 AM
I know I messed the title up but here is an example of what i mean.
http://www.templatesfreelance.com/preview_temp.php?x=105&y=36&idtem=39

I don't wanna make a site like that I have just forgotten how do that, and if someone could tell me or give me a code that would be great thanks in advance.
-Shades, Admin.


Hello Dear Admin,

I am Senior HTML Coder/ Quality Control Supervisor from FreeLance City Inc.
I find this link in my web site statistics and because I don`t understand what you mean. You can send your question to support@templatesfreelance.com
I try to help you.

Best Regards

Shades
12-10-2005, 06:39 PM
Oh hello, the admin. wasn't asking the question I was, I think I can find it here, I wouldn't want to bother you, your a web template designer, not a coding support group but thank you none the less.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum