Probleme CSS avec PHP.
Résolu/Fermé
Utilisateur anonyme
-
17 janv. 2011 à 20:39
theshadoo Messages postés 786 Date d'inscription samedi 26 mai 2007 Statut Membre Dernière intervention 3 mai 2016 - 19 janv. 2011 à 15:06
theshadoo Messages postés 786 Date d'inscription samedi 26 mai 2007 Statut Membre Dernière intervention 3 mai 2016 - 19 janv. 2011 à 15:06
Bonjour,
Je suis en train de créer un site avec du PHP mais je teste mon design sans passer par mon serveur. Jusque là, tous ce passe bien. Par contre, quand j'ouvre mes pages avec le serveur, une partie du CSS ne fonctionne pas ! Avez-vous une réponse à ce problème ?
Je suis en train de créer un site avec du PHP mais je teste mon design sans passer par mon serveur. Jusque là, tous ce passe bien. Par contre, quand j'ouvre mes pages avec le serveur, une partie du CSS ne fonctionne pas ! Avez-vous une réponse à ce problème ?
A voir également:
- Probleme CSS avec PHP.
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Alert php ✓ - Forum PHP
- Get_magic_quotes_gpc php 8 ✓ - Forum PHP
- Php alert - Forum PHP
4 réponses
theshadoo
Messages postés
786
Date d'inscription
samedi 26 mai 2007
Statut
Membre
Dernière intervention
3 mai 2016
123
17 janv. 2011 à 20:49
17 janv. 2011 à 20:49
déjà comment as tu fichus ton css, ton code html et ton code php ? Tout dépends comment tu l'inclus il y a de très nombreuses manières que j'ai pu voir chez des amateurs.
Poste ton fichier css et php sur un site de stockage de fichier car si je te demande de poster ton code tu risques de nous balancer des pages et des pages de codes en vrac complètement ilisible
Poste ton fichier css et php sur un site de stockage de fichier car si je te demande de poster ton code tu risques de nous balancer des pages et des pages de codes en vrac complètement ilisible
Utilisateur anonyme
17 janv. 2011 à 20:51
17 janv. 2011 à 20:51
Non, je fais bien et proprement mes codes, (je pourrait avoir un diplôme pour ça !! ;-) ) ça me fait ça depuis deux jours.
arthezius
Messages postés
3538
Date d'inscription
jeudi 15 mai 2008
Statut
Membre
Dernière intervention
11 septembre 2016
475
17 janv. 2011 à 21:28
17 janv. 2011 à 21:28
As tu installer un serveur web local pour tes tests?
Il est possible que les chemins soit correct sur ton PC mais ne le soit pas sur un serveur.
Exemple: s'ils commencent par file://.... c'est pas bon.
Installe un serveur web local (Wamp, EsayPHP ,etc...) si c'est pas déjà fait et vérifie avec ça.
Ensuite, on verra.
Il est possible que les chemins soit correct sur ton PC mais ne le soit pas sur un serveur.
Exemple: s'ils commencent par file://.... c'est pas bon.
Installe un serveur web local (Wamp, EsayPHP ,etc...) si c'est pas déjà fait et vérifie avec ça.
Ensuite, on verra.
arthezius
Messages postés
3538
Date d'inscription
jeudi 15 mai 2008
Statut
Membre
Dernière intervention
11 septembre 2016
475
19 janv. 2011 à 05:10
19 janv. 2011 à 05:10
Si tu mets le tout dans un sous-dossier sur l'un et pas sur l'autre, tu peux avoir des problèmes de chemin suivant comment tu les as défini.
Sinon je vois pas trop.
As tu un lien vers ton site pour qu'on puisse voir les problèmes que tu as?
Sinon je vois pas trop.
As tu un lien vers ton site pour qu'on puisse voir les problèmes que tu as?
theshadoo
Messages postés
786
Date d'inscription
samedi 26 mai 2007
Statut
Membre
Dernière intervention
3 mai 2016
123
19 janv. 2011 à 11:04
19 janv. 2011 à 11:04
De toute façon fait voir ton code ou si c'est online donne un lien comme je t'ai dit car si non je ne vois pas ce que l'on pourrait faire d'autre
Utilisateur anonyme
Modifié par louchton le 19/01/2011 à 12:43
Modifié par louchton le 19/01/2011 à 12:43
Voila mon code html avec le php.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="Essai" href="style.css" />
<title>Accueil : Webma-site</title>
</head>
<body>
<div class="onglets_html">
<div class="onglets">
<div class="onglet_y onglet"><a href="index.php">Accueil</a></div>
<div class="onglet_n onglet"><a href="membres.php">Membres</a></div>
<div class="onglet_n onglet"><a href="faire_site.php">Faire son site</a></div>
<div class="onglet_n onglet"><a href="autre.php">Autre</a></div>
<div class="onglet_n onglet"><a href="admin/admin.php">Administration</a></div>
</div>
</div>
<br/>
<div class="header">
<a href="index.php"><h1>Webma-site</h1></a>
</div>
<div class="content">
<p>Bonjour,</p>
<p>Bienvenue sur Webma-site.</p>
<br/>
<h4>NEWS :</h4>
<br/>
<?php
mysql_connect("localhost", "root", "");
mysql_select_db("new");
// On récupère les 5 dernières news
$retour = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0, 5');
while ($donnees = mysql_fetch_array($retour))
{
?>
<div class="news">
<h3>
<?php echo $donnees['titre']; ?>
<em>le <?php echo date('d/m/Y a H\hi', $donnees['timestamp']); ?></em>
</h3>
<p>
<?php
// On enlève les éventuels antislash PUIS on crée les entrées en HTML (<br />)
$contenu = nl2br(stripslashes($donnees['contenu']));
echo $contenu;
?>
</p>
</div>
<?php
} // Fin de la boucle des news
?>
<p><a href="liste_new.php">Liste des NEWS</a>
</div>
<div class="foot">
<p>Me contacter par : <a href="mailto:email">E-Mail</a> - <a href='contact.php'>Formlaire de contact</a> !<br/>
<a href='info.php'>Info. Legales</a><br/>
</div>
</body>
</html>
Puis le code css :
.news h3
{
background-color:black;
color:white;
font-size:0.9em;
margin-bottom:0px;
}
.news p
{
background-color:#CCCCCC;
margin-top:0px;
}
.news
{
width:70%;
margin:auto;
}
*
{
margin:0px;
padding:0px;
}
body
{
background:#e2f6ff url('images/background.gif') center top no-repeat;
padding-left:10%;
padding-right:10%;
font-family:Arial, Geneva, sans-serif;
}
a
{
text-decoration:none;
color:chocolate;
}
a:hover
{
color:coral;
}
img, table, tr, td
{
border:0px;
}
h1
{
text-align:center;
margin:0px;
padding:0px;
}
.clean
{
clear:both;
}
.left
{
text-align:left;
}
.center
{
text-align:center;
}
input
{
width:150px;
}
label
{
width:200px;
display:inline-block;
vertical-align:top;
text-align:left;
}
table
{
border-spacing:0px;
background:#ffffff;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
padding:0px;
width:95%;
margin:5px auto 5px auto;
}
tr
{
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
margin:0px;
}
td, th
{
margin:0px;
border:0px;
padding:3px;
text-align:center;
}
.header
{
margin:auto;
margin-top:10px;
padding:15px;
background:url('images/bluec_30p.png');
width:70%;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
text-align:center;
}
.foot
{
text-align:center;
background:url('images/bluec_30p.png');
width:70%;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
margin:auto;
padding:10px;
margin-top:20px;
}
.content
{
background:url('images/bluec_30p.png');
width:65%;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
margin:auto;
padding:20px;
margin-top:20px;
}
.big
{
font-size:1.2em;
}
.small
{
font-size:0.7em;
}
.message
{
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
padding:20px;
margin:auto;
width:500px;
background:url('images/black_40p.png');
color:#ffffff;
text-align:center;
font-weight:bold;
margin-top:20px;
}
.messages_table td
{
border-top:1px solid #aaaaaa;
vertical-align:top;
}
.author
{
width:150px;
border-right:1px solid #aaaaaa;
}
.title_cell
{
width:45%;
}
.date
{
font-style:italic;
text-align:right;
font-size:0.9em;
margin-right:10px;
}
.link_new_pm
{
font-size:1.3em;
font-weight:bold;
margin:5px 0px 5px 0px;
display:inline-block;
border:1px solid #dddddd;
background:#ffffff;
padding:5px;
}
.header h1
{
color:orange;
}
.onglet
{
display:inline-block;
margin-left:3px;
margin-right:3px;
padding:3px;
border:1px solid black;
cursor:pointer;
}
.onglet a
{
color:black;
text-decoration:none;
}
.onglet_n
{
background:cyan;
border-bottom:1px solid black;
}
.onglet_y
{
background:blue;
padding-bottom:4px;
}
.onglet a :hover
{
color:white;
text-decoration:none;
}
.onglet_n :hover
{
background:DeepSkyBlue;
border-bottom:1px solid black;
}
.onglet_y :hover
{
background:DeepSkyBlue;
padding-bottom:4px;
}
En fait, c'est les onglets en haut de la page qui ne fonctionnent pas !!
C'est le gras qui ne fonctionne pas !!
En fait, je vien de retester pour prendre un screen et ça marche !!! Merci quand même a tous le monde !!
Il y a des jour ou tous va bien, ne vous inquiétez pas, ca passe !!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="Essai" href="style.css" />
<title>Accueil : Webma-site</title>
</head>
<body>
<div class="onglets_html">
<div class="onglets">
<div class="onglet_y onglet"><a href="index.php">Accueil</a></div>
<div class="onglet_n onglet"><a href="membres.php">Membres</a></div>
<div class="onglet_n onglet"><a href="faire_site.php">Faire son site</a></div>
<div class="onglet_n onglet"><a href="autre.php">Autre</a></div>
<div class="onglet_n onglet"><a href="admin/admin.php">Administration</a></div>
</div>
</div>
<br/>
<div class="header">
<a href="index.php"><h1>Webma-site</h1></a>
</div>
<div class="content">
<p>Bonjour,</p>
<p>Bienvenue sur Webma-site.</p>
<br/>
<h4>NEWS :</h4>
<br/>
<?php
mysql_connect("localhost", "root", "");
mysql_select_db("new");
// On récupère les 5 dernières news
$retour = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0, 5');
while ($donnees = mysql_fetch_array($retour))
{
?>
<div class="news">
<h3>
<?php echo $donnees['titre']; ?>
<em>le <?php echo date('d/m/Y a H\hi', $donnees['timestamp']); ?></em>
</h3>
<p>
<?php
// On enlève les éventuels antislash PUIS on crée les entrées en HTML (<br />)
$contenu = nl2br(stripslashes($donnees['contenu']));
echo $contenu;
?>
</p>
</div>
<?php
} // Fin de la boucle des news
?>
<p><a href="liste_new.php">Liste des NEWS</a>
</div>
<div class="foot">
<p>Me contacter par : <a href="mailto:email">E-Mail</a> - <a href='contact.php'>Formlaire de contact</a> !<br/>
<a href='info.php'>Info. Legales</a><br/>
</div>
</body>
</html>
Puis le code css :
.news h3
{
background-color:black;
color:white;
font-size:0.9em;
margin-bottom:0px;
}
.news p
{
background-color:#CCCCCC;
margin-top:0px;
}
.news
{
width:70%;
margin:auto;
}
*
{
margin:0px;
padding:0px;
}
body
{
background:#e2f6ff url('images/background.gif') center top no-repeat;
padding-left:10%;
padding-right:10%;
font-family:Arial, Geneva, sans-serif;
}
a
{
text-decoration:none;
color:chocolate;
}
a:hover
{
color:coral;
}
img, table, tr, td
{
border:0px;
}
h1
{
text-align:center;
margin:0px;
padding:0px;
}
.clean
{
clear:both;
}
.left
{
text-align:left;
}
.center
{
text-align:center;
}
input
{
width:150px;
}
label
{
width:200px;
display:inline-block;
vertical-align:top;
text-align:left;
}
table
{
border-spacing:0px;
background:#ffffff;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
padding:0px;
width:95%;
margin:5px auto 5px auto;
}
tr
{
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
margin:0px;
}
td, th
{
margin:0px;
border:0px;
padding:3px;
text-align:center;
}
.header
{
margin:auto;
margin-top:10px;
padding:15px;
background:url('images/bluec_30p.png');
width:70%;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
text-align:center;
}
.foot
{
text-align:center;
background:url('images/bluec_30p.png');
width:70%;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
margin:auto;
padding:10px;
margin-top:20px;
}
.content
{
background:url('images/bluec_30p.png');
width:65%;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
margin:auto;
padding:20px;
margin-top:20px;
}
.big
{
font-size:1.2em;
}
.small
{
font-size:0.7em;
}
.message
{
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
padding:20px;
margin:auto;
width:500px;
background:url('images/black_40p.png');
color:#ffffff;
text-align:center;
font-weight:bold;
margin-top:20px;
}
.messages_table td
{
border-top:1px solid #aaaaaa;
vertical-align:top;
}
.author
{
width:150px;
border-right:1px solid #aaaaaa;
}
.title_cell
{
width:45%;
}
.date
{
font-style:italic;
text-align:right;
font-size:0.9em;
margin-right:10px;
}
.link_new_pm
{
font-size:1.3em;
font-weight:bold;
margin:5px 0px 5px 0px;
display:inline-block;
border:1px solid #dddddd;
background:#ffffff;
padding:5px;
}
.header h1
{
color:orange;
}
.onglet
{
display:inline-block;
margin-left:3px;
margin-right:3px;
padding:3px;
border:1px solid black;
cursor:pointer;
}
.onglet a
{
color:black;
text-decoration:none;
}
.onglet_n
{
background:cyan;
border-bottom:1px solid black;
}
.onglet_y
{
background:blue;
padding-bottom:4px;
}
.onglet a :hover
{
color:white;
text-decoration:none;
}
.onglet_n :hover
{
background:DeepSkyBlue;
border-bottom:1px solid black;
}
.onglet_y :hover
{
background:DeepSkyBlue;
padding-bottom:4px;
}
En fait, c'est les onglets en haut de la page qui ne fonctionnent pas !!
C'est le gras qui ne fonctionne pas !!
En fait, je vien de retester pour prendre un screen et ça marche !!! Merci quand même a tous le monde !!
Il y a des jour ou tous va bien, ne vous inquiétez pas, ca passe !!!
theshadoo
Messages postés
786
Date d'inscription
samedi 26 mai 2007
Statut
Membre
Dernière intervention
3 mai 2016
123
19 janv. 2011 à 15:06
19 janv. 2011 à 15:06
Sans doute le cache tout simplement alors.
Par contre le title sur le link css tu peux l'enlevé il n'y en a pas besoin et ca n'est pas dans les normes.
Par contre le title sur le link css tu peux l'enlevé il n'y en a pas besoin et ca n'est pas dans les normes.