Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Centering a website, the solution.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Martin1
Super User

Netherlands
626 Posts

Posted - 17 Oct 2004 :  02:44:15  Show Profile  Reply with Quote
For those of you that can't wait for DHE2 (which will have this feature) I will post here the solution to centering your website in high resolutions.

This:

<style type="text/css">
#centered {
margin: 0px auto; width: 780px; position: relative
}
body {
text-align: center
}
</style>

goes between the <head> and </head> tag.

It might be necessary to change the width: 780px. This width works good on a site that is 772 pixels wide but if your site is different you need to try some different widths (example width: 880px;). Just play around with the numbers, you will find the correct one.

and this:

<div id="centered">
here comes the content of the site (all of it)
</div>

comes directly after the <body> tag.

In totall it will look something like this for a page of 772 pixels wide:

<!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</title>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
#centered {
margin: 0px auto; width: 780px; position: relative
}
body {
tect=align: center
}
</style>
</head>
<body>
<div id="centered">
here comes the content of the site (all of it)
</div>
</body>
</html>

Hope some of you will have a use for it.

Regards,
Martin

Edited by - Martin1 on 17 Oct 2004 02:51:52

n/a
deleted

492 Posts

Posted - 17 Oct 2004 :  12:08:40  Show Profile  Reply with Quote
Thanks Martin1.
Should be very useful!

Ciao Ciao De.
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 19 Oct 2004 :  08:43:35  Show Profile  Visit s.dav's Homepage  Reply with Quote
Many thanks Martin1!

Regards, Davide
Go to Top of Page

JayTee
Novice

United Kingdom
3 Posts

Posted - 14 Dec 2004 :  12:04:40  Show Profile  Visit JayTee's Homepage  Reply with Quote
You have an error in your css.
Your css works in Firefox/Mozilla, but IE take more notice of the body text-align element - and you have made some typographical errors!
Once these are corrected, it works in both Mozilla/Firefox and IE.
Change your body element from "tect=align" to "text-align" and everything is OK

so the correct declaration should be:
body {
text-align: center;
}
Go to Top of Page

Martin1
Super User

Netherlands
626 Posts

Posted - 14 Dec 2004 :  20:30:51  Show Profile  Reply with Quote
Oops a typo. Sorry about that

Thanks for noticing it.

Martin
Go to Top of Page

nodosur
Practical

Argentina
16 Posts

Posted - 08 Jan 2005 :  15:24:42  Show Profile  Visit nodosur's Homepage  Reply with Quote
OK...Ok....Ok...
thanks

but since is made to include the sentences <div id="centered"> and </div> with Editor Dynamic HTML Editor soon to include the rest of code within these two tag's ?


please see thread http://www.hexagora.com/forum/topic.asp?TOPIC_ID=404

Salu2 cordi@les a To2 y que alguien perdone nuestros PK2.
?
Wilde-Buenos Aires-Argentina
Go to Top of Page

nodosur
Practical

Argentina
16 Posts

Posted - 14 Jan 2005 :  01:46:33  Show Profile  Visit nodosur's Homepage  Reply with Quote
asi como Dynamic HTML Editor incluye automaticamente el script de pre-load de las imagenes tambien deberia incluir el script de centrado de texto, se deberia pre-setear que tipo de definicion de pantalla se desea trabajar, 800x600 o 1024x768 sabiendo que el tope para la primera debe ser de 772 pixeles y para la segunda de 1016. el script se deberia incluir automaticamente en el head y el <div id="centered"> incluirlo automaticamente luego del <dhePreloadImgs... y el </div> como ultima sentencia antes del tag body ... y el resto de las sentencias dentro de estos DIV

Salu2 cordi@les a To2 y que alguien perdone nuestros PK2.
?
Wilde-Buenos Aires-Argentina
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000