Problème background css code html ?
Utilisateur anonyme
-
yvau Messages postés 17 Date d'inscription Statut Membre Dernière intervention -
yvau Messages postés 17 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
j'ai essayé de créer un css backgound pour mettre une image en arriere plan mais celle-ci ne s'affiche pas
correctement. Voyez-vous ou se trouve l'erreur dans le code HTML qui suit, pour que je comprenne
d'ou ça vient ?
merci par avance de votre aide
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.partitionfondgrandformat {
background-attachment: fixed;
background-image: url(images/partitionfondgrandformat.jpg);
background-repeat: no-repeat;
background-position: 1280px 1024px;}
-->
</style>
</head>
<body bgcolor=#6600CC>
<p class="partitionfondgrandformat"> </p>
<p class="partitionfondgrandformat"> </p>
<p> </p>
<table width="800" height="600" border="4" align="center" cellpadding="0" cellspacing="0" id="index.htm">
<tr>
<td align="left" valign="top">
<p><img src="images/Index1sitenoam.jpg" width="800" height="600" align="middle"></p></td>
</tr>
</table>
<p class="partitionfondgrandformat"> </p>
<p align="center"><a href="indexfrance.htm" class="partitionfondgrandformat"><img src="images/FRA.GIF" name="drapeaufrancais" width="54" height="33" border="0" align="top" id="drapeaufrancais"></a>
<a href="indexukthebluenote.htm"><img src="images/UK.GIF" width="52" height="34" border="0"></a>
</p>
<h1> </h1>
</html>
j'ai essayé de créer un css backgound pour mettre une image en arriere plan mais celle-ci ne s'affiche pas
correctement. Voyez-vous ou se trouve l'erreur dans le code HTML qui suit, pour que je comprenne
d'ou ça vient ?
merci par avance de votre aide
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.partitionfondgrandformat {
background-attachment: fixed;
background-image: url(images/partitionfondgrandformat.jpg);
background-repeat: no-repeat;
background-position: 1280px 1024px;}
-->
</style>
</head>
<body bgcolor=#6600CC>
<p class="partitionfondgrandformat"> </p>
<p class="partitionfondgrandformat"> </p>
<p> </p>
<table width="800" height="600" border="4" align="center" cellpadding="0" cellspacing="0" id="index.htm">
<tr>
<td align="left" valign="top">
<p><img src="images/Index1sitenoam.jpg" width="800" height="600" align="middle"></p></td>
</tr>
</table>
<p class="partitionfondgrandformat"> </p>
<p align="center"><a href="indexfrance.htm" class="partitionfondgrandformat"><img src="images/FRA.GIF" name="drapeaufrancais" width="54" height="33" border="0" align="top" id="drapeaufrancais"></a>
<a href="indexukthebluenote.htm"><img src="images/UK.GIF" width="52" height="34" border="0"></a>
</p>
<h1> </h1>
</html>
A voir également:
- Problème background css code html ?
- Code ascii - Guide
- Code puk bloqué - Guide
- Comment déverrouiller un téléphone quand on a oublié le code - Guide
- Code activation windows 10 - Guide
- Editeur html - Télécharger - HTML
1 réponse
Bonjour
Ce que je te conseille c'est déjà d'enlever bgcolor=#6600CC à ta balise body et dessayer
<body class="partitionfondgrandformat">
Ou plus simple crée
une fonction body dans ta feuille de style comme ceci
BODY
{
background:url(file:background.jpg);
}
fais moi signe si tu n'y arrive pas
Cordialement Yvau
Ce que je te conseille c'est déjà d'enlever bgcolor=#6600CC à ta balise body et dessayer
<body class="partitionfondgrandformat">
Ou plus simple crée
une fonction body dans ta feuille de style comme ceci
BODY
{
background:url(file:background.jpg);
}
fais moi signe si tu n'y arrive pas
Cordialement Yvau
en fait, je n'arrive pas à faire ce que tu me conseilles, car je suis encore assez novice en html
Peux-tu me dire exactement à quel endroit je dois ecrire la ligne, et aussi
l'écriture exacte
merci
BODY
{
background:url(file:background.jpg);
}
dois se trouver entre les balises <style> </style>
que j'ai vu dans ton code
enlève aussi les autres balises <!-- --> qui sy trouve.
Bonn, je n'y arrive pas, je dois faire des erreurs, voici ce que j'ai fait
Est-ce par hasard vous pourriez corriger le code, et me le renvoyer en copier coller, comment ça
je pourrais comprendre mon erreur, merci
J'en profite pour vous dire aussi, que les CSS que j'effectue dans dreamweaver ne veulent pas
s'appliquer (que ce soit couleur texte, background etc) , je ne comprends pas pourquoi ? :
:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
{background:url:partitionfondgrandformat.jpg;
}
</style>
</head>
<body
<table width="800" height="600" border="4" align="center" cellpadding="0" cellspacing="0" id="index.htm">
<tr>
<td align="left" valign="top">
<p><img src="images/Index1sitenoam.jpg" width="800" height="600" align="middle"></p></td>
</tr>
</table>
<p class="partitionfondgrandformat"> </p>
<p align="center"><a href="indexfrance.htm" class="partitionfondgrandformat"><img src="images/FRA.GIF" name="drapeaufrancais" width="54" height="33" border="0" align="top" id="drapeaufrancais"></a>
<a href="indexukthebluenote.htm"><img src="images/UK.GIF" width="52" height="34" border="0"></a>
</p>
<h1> </h1>
</html>
Sinon pour que ton css externe "agisse" sur ton HTML il faut créer le lien dans ta page HTML. Tu trouveras la méthode sur : https://openclassrooms.com/fr/
Bon courage
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
BODY
{background:url(partitionfondgrandformat.jpg);}
</style>
</head>
<body >
<table width="800" height="600" border="4" align="center" cellpadding="0" cellspacing="0" id="index.htm">
<tr>
<td align="left" valign="top">
<p><img src="images/Index1sitenoam.jpg" width="800" height="600" align="middle"></p></td>
</tr>
</table>
<p class="partitionfondgrandformat"> </p>
<p align="center"><a href="indexfrance.htm" class="partitionfondgrandformat"><img src="images/FRA.GIF" name="drapeaufrancais" width="54" height="33" border="0" align="top" id="drapeaufrancais"></a>
<a href="indexukthebluenote.htm"><img src="images/UK.GIF" width="52" height="34" border="0"></a>
</p>
<h1> </h1>
</html>