Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Centering a website, the solution.

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert Email Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Martin1 Posted - 17 Oct 2004 : 02:44:15
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
6   L A T E S T    R E P L I E S    (Newest First)
nodosur Posted - 14 Jan 2005 : 01:46:33
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
nodosur Posted - 08 Jan 2005 : 15:24:42
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
Martin1 Posted - 14 Dec 2004 : 20:30:51
Oops a typo. Sorry about that

Thanks for noticing it.

Martin
JayTee Posted - 14 Dec 2004 : 12:04:40
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;
}
s.dav Posted - 19 Oct 2004 : 08:43:35
Many thanks Martin1!
n/a Posted - 17 Oct 2004 : 12:08:40
Thanks Martin1.
Should be very useful!

Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000