Forum-webmaster
Technique - programmation => HTML / CSS / XHTML => Message commencé par: borsalino le le 16-12-2008 a 22:20:26

Titre: cherche un script pour centrer les pages
Posté par: borsalino le le 16-12-2008 a 22:20:26

bonjour j ai un probleme selon la résolution mes pages reste toujour a gauche !!!!!
existe t il un script pour les centrer ????
voila mes sites ..
http://www.radioemocao.zik.dj/

http://www.saudades-portugal-tchat.0rg.fr/


merci a tous .... ;) ;)

Titre: Re:cherche un script pour centrer les pages
Posté par: HiRoN le le 17-12-2008 a 15:41:51

Salut,

Par exemple en englobant le tout dans un <div> que tu centres en utilisant cette technique (CSS) : http://xhtml.developpez.com/faq/?page=marges_alignement#CSS_centrer_horizontalement (http://xhtml.developpez.com/faq/?page=marges_alignement#CSS_centrer_horizontalement)

Titre: Re:cherche un script pour centrer les pages
Posté par: easyocas le le 18-12-2008 a 20:59:17

Tu mets le tout dans un div avec id="exemple" puis dans ta feuille de style css :
DIV#exemple {
margin:auto;
}
c'est pas plus compliqué que ca

Titre: Re:cherche un script pour centrer les pages
Posté par: borsalino le le 19-12-2008 a 12:30:10

merci , je vais essayé :D :D
je vous tien au courant si c est bon .... ;) ;)

Titre: Re:cherche un script pour centrer les pages
Posté par: borsalino le le 19-12-2008 a 12:43:25

non je n y arrive toujour pas voila mon début de script ... ??? :-[
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="verify-v1" content="yED6kSh4ivCDCQHrcvmIv4dVbnOtRc85U5nxCq2fLsM=" />
<title>radio emo&ccedil;ao</title>
<style type="text/css">
<!--
.Style19 {font-size: 24px}
-->
</style>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; ]
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
.Style1 {
   font-size: 36px;
   font-weight: bold;
   color: #FF3300;
}
.Style2 {
   font-size: 24px;
   font-weight: bold;
   color: #CC6600;
}
body {
   background-color: #000000;
}
.Style6 {color: #FF0000}
.Style10 {
   color: #00FFFF;
   font-size: 24px;
}
.Style14 {font-weight: bold; color: #009F50;}
.Style15 {
   color: #A6A600;
   font-weight: bold;
}
.Style20 {
   color: #CC9900;
   font-size: 24px;
}
.Style22 {
   color: #FF3300;
   font-weight: bold;
   font-size: 18px;
}
.Style25 {font-weight: bold; color: #009900;}
-->
</style>
</head>

<body>
<div id="Layer1" style="position:absolute; left:11px; top:17px; width:1363px; height:1356px; z-index:1"></div>
<div id="Layer2" style="position:absolute; left:15px; top:21px; width:1359px; height:88px; z-index:2"></div>
<div id="Layer3" style="position:absolute; left:58px; top:41px; width:222px; height:60px; z-index:3">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="220" height="59">
<param name="movie" value="button1.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
<embed src="button1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="220" height="59" bgcolor="#000000"></embed>
</object>

Titre: Re:cherche un script pour centrer les pages
Posté par: easyocas le le 19-12-2008 a 13:21:23

Salut ,
je te conseil de crée une feuille de style CSS :
exemple :
style.css :


Code:

@charset "utf-8";
/* La c'est la feuille de style */
DIV#exemple { /* Le id du div contenu */
margin:auto;
width:1363px /* Je te conseille 1200px max */
}
.Style1 {
font-size: 36px;
font-weight: bold;
color: #FF3300;
}
.Style2 {
font-size: 24px;
font-weight: bold;
color: #CC6600;
}
body {
background-color: #000000;
}
.Style6 {color: #FF0000}
.Style10 {
color: #00FFFF;
font-size: 24px;
}
.Style14 {font-weight: bold; color: #009F50;}
.Style15 {
color: #A6A600;
font-weight: bold;
}
.Style20 {
color: #CC9900;
font-size: 24px;
}
.Style22 {
color: #FF3300;
font-weight: bold;
font-size: 18px;
}
.Style25 {font-weight: bold; color: #009900;}


ta page :

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
<meta name="verify-v1" content="yED6kSh4ivCDCQHrcvmIv4dVbnOtRc85U5nxCq2fLsM=" />
<title>radio emo&ccedil;ao</title>
<style type="text/css">
<!--
.Style19 {font-size: 24px}
-->
</style>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; ]
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>

</head>

<body>

<div id="exemple"> <!-- Ici le div contenu -->

<div id="Layer1" style="position:absolute; left:11px; top:17px; width:1363px; height:1356px; z-index:1"></div>
<div id="Layer2" style="position:absolute; left:15px; top:21px; width:1359px; height:88px; z-index:2"></div>
<div id="Layer3" style="position:absolute; left:58px; top:41px; width:222px; height:60px; z-index:3">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="220" height="59">
<param name="movie" value="button1.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
<embed src="button1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="220" height="59" bgcolor="#000000"></embed>
</object>

</div> <!-- Find du div Contenu -->


Titre: Re:cherche un script pour centrer les pages
Posté par: borsalino le le 19-12-2008 a 18:56:43

bonjour , tu me dit de crée une feuille de style CSS , la je suis perdu ??? ???
moi j ai fais mes sites avec dreamweaver mx 2004 . je debute dans le webmastering peut tu m expliquer le plus simple possible merci easyocas :) :)
en tout deja je veux te dire un grand merci pour t on aide . ;) ;)

Titre: Re:cherche un script pour centrer les pages
Posté par: easyocas le le 19-12-2008 a 19:01:56

Ben pour pas compliquer colle simplement le code de style.css dans ta page html
entre les balise :
<style>
ici
</style>
ici la page qui continue

Titre: Re:cherche un script pour centrer les pages
Posté par: borsalino le le 20-12-2008 a 00:17:03

ok merci je vais essayer ca :D :D

Titre: Re:cherche un script pour centrer les pages
Posté par: borsalino le le 20-12-2008 a 18:43:05

bonjour , easyocas j ai essayé ca ne marche toujour pas l ami durrrrrrrrrrrr ??? ??? ???
peut tu me faire le debut de script en reprenant le mien , comme ca j ai plus que a faire un copier coller merci encore une foi pour t on aide ;) ;)


Titre: Re:cherche un script pour centrer les pages
Posté par: easyocas le le 20-12-2008 a 19:33:15

Voila le code Complet :

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="verify-v1" content="yED6kSh4ivCDCQHrcvmIv4dVbnOtRc85U5nxCq2fLsM=" />
<title>radio emo&ccedil;ao</title>
<style type="text/css">
<!--
/* La c'est la feuille de style */
DIV#exemple { /* Le id du div contenu */
margin:auto;
width:1363px /* Je te conseille 1200px max */
}
.Style1 {
font-size: 36px;
font-weight: bold;
color: #FF3300;
}
.Style2 {
font-size: 24px;
font-weight: bold;
color: #CC6600;
}
body {
background-color: #000000;
}
.Style6 {color: #FF0000}
.Style10 {
color: #00FFFF;
font-size: 24px;
}
.Style14 {font-weight: bold; color: #009F50;}
.Style15 {
color: #A6A600;
font-weight: bold;
}
.Style20 {
color: #CC9900;
font-size: 24px;
}
.Style22 {
color: #FF3300;
font-weight: bold;
font-size: 18px;
}
.Style25 {font-weight: bold; color: #009900;}
.Style19 {font-size: 24px}
-->
</style>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; ]
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>

</head>

<body>

<div id="exemple"> <!-- Ici le div contenu -->

<div id="Layer1" style="position:absolute; left:11px; top:17px; width:1363px; height:1356px; z-index:1"></div>
<div id="Layer2" style="position:absolute; left:15px; top:21px; width:1359px; height:88px; z-index:2"></div>
<div id="Layer3" style="position:absolute; left:58px; top:41px; width:222px; height:60px; z-index:3">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="220" height="59">
<param name="movie" value="button1.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
<embed src="button1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="220" height="59" bgcolor="#000000"></embed>
</object>

</div> <!-- Find du div Contenu -->

Titre: Re:cherche un script pour centrer les pages
Posté par: borsalino le le 22-12-2008 a 22:36:06

bonjour , easyocas j ai fais le copier collé de ton script et ca ne marche toujour pas l ami ??? ??? ???
merci pour ton aide encore une foi l ami ;) ;) ;)

Titre: Re:cherche un script pour centrer les pages
Posté par: dvilston le le 04-01-2009 a 14:56:02

bah pour centrer une page tu n'as ni plus ni moins besoin que de css et non d'un script.

Quand je vois l'état de tes 2 sites, il faut vraiment tu les refasse absolument :o enfin prendre la vague web 2.0, le css séparé, de même pour le js, éviter de faire les pages avec le mode graphiste de dreamweaver, c'est le code en lui même qui est horrible. Si tu veux vraiment devenir un bon webmaster alors apprend le xHTML avec le bloc-note. dreamweaver est trop gros, trop lourd... tu as besoin d'un logiciel simple et surtout qui ne te crée pas de code à ta place.

Pour centrer ton contenu il te suffit de le placer dans une div qui fait 100% de large et centré, le contenu à l'interieur doit avoir une largeur fixe de 1010px.

Sinon pour le reste ajoute un player sur le site de radio vu que j'avais pas franchement envie de l'écouter, surtout que j'étais déjà entrain découter de la musique... et vire le noir c'est pas attrayant pour ce type de site

bon courage
++



Forum-webmaster | Actionné par YaBB SE
© 2001-2003, YaBB SE Dev Team. Tous droits réservés.