Print css
powpowland
Messages postés
395
Date d'inscription
Statut
Membre
Dernière intervention
-
XxIncontournablexX Messages postés 58 Date d'inscription Statut Membre -
XxIncontournablexX Messages postés 58 Date d'inscription Statut Membre -
Bonjour,
j'ai une feuille de style pour l'impression et j'ai beau vouloir mettre background : #000000, le fond ressort toujours blanc, comment faire pour qu'il ressorte noir ??
et c'est juste à quelque endroit de la page ce n'est pas partout...
j'ai une feuille de style pour l'impression et j'ai beau vouloir mettre background : #000000, le fond ressort toujours blanc, comment faire pour qu'il ressorte noir ??
et c'est juste à quelque endroit de la page ce n'est pas partout...
Configuration: Windows Vista Firefox 3.0.13
15 réponses
-
Tu l'as mis sous quelle balise?
Le body, *, ou autre? -
sur un id qui lui est sur un tr
-
Tu pourrais nous donner un bout de code pour nous montrer où est ton problème stp?
-
voici le print css, il y a que le background qui ne marche pas, sinon les textes changent bien de couleurs sauf vers le blanc :
html { width : 744; font-family : arial; text-align:justify; height : 1052; } table{ width : 100%; height : 100%; border-collapse : collapse; } #annee{ font-style : italic; text-align : right; } #photo{ text-align : center; } #titre{ background-color: : #000000; color : #ffffff; font-weight : bold; font-size : 20px; height : 3%; } #titre1{ background-color: : #000000; color : white; height : 10%; } .lettre1{ letter-spacing : 77px; } .lettre2{ letter-spacing : 50px; } .lettre3{ letter-spacing : 67px; } .lettre4{ letter-spacing : 109px; } .lettre5{ height : 1%; background : black; }
et le html :<html> <head> <link rel="stylesheet" href="index.css" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" media="print" href="print.css" /> </head> <body> <table> <tr id="titre1"><td align="top"> blalabla</td><td id="photo">photo</td></tr> <tr valign="top"><td id="titre" class="lettre1" colspan="2">blabla</td></tr> <tr valign="top"><td id='annee'>2009 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>2008 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>2006 : </td><td>bla</td></tr> <tr align="top"><td id="titre" class="lettre2" colspan="2">blabla</td></tr> <tr valign="top"><td id='annee'>2008/2009 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2008 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2007 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Juin 2007 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2006 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Février 06 et 08 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2005 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Hiver de 03 à 08 : </td><td>bla</td></tr> <tr valign="top"><td id="titre" class="lettre3" colspan="2">bla</td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla<br> bla<br> bla<br> bla<br> bla<br></td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla<br> bla<br> bla<br></td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla<br> bla<br> bla</td></tr> <tr><td id="titre" class="lettre4" colspan="2">bla</td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla</td></tr> <tr><td class="lettre5" colspan="2"></td></tr> </table> </body> </html> -
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question -
-
excuse moi je sais pas si c'est la solution mais bon je me lance.
est ce normal que tu ai mis background-color: #000000;
et ensuite color: white;
ca serait possible que il est interprete le color comme le background et comme il est en dernier il serait affiche.
si c'etait pour du texte, mets text-color -
-
#titre{
background-color: : #000000;
color : #ffffff;
font-weight : bold;
font-size : 20px;
height : 3%;
}
#titre1{
background-color: : #000000;
color : white;
height : 10%;
}
DEUX FOIS DEUX POINTS MEC -
ça change rien...
-
Tu ne peux mettre qu'une seule fois le même id sur une page.
Remplace tes id en plusieurs fois par des class="" et donc dans ton CSS remplace les # correspondants par des .
Essaie déjà de faire ça.
EDIT : je suis d'accord qu'il faut enlever les doubles : pour le background-color.
-
moi ça marche:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Soluce</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> html { width : 744; font-family : arial; text-align:justify; height : 1052; } table{ width : 100%; height : 100%; border-collapse : collapse; } #annee{ font-style : italic; text-align : right; } #photo{ text-align : center; } #titre{ background-color:#000000; color : #ffffff; font-weight : bold; font-size : 20px; height : 3%; } #titre1{ background-color:#000000; color : white; height : 10%; } .lettre1{ letter-spacing : 77px; } .lettre2{ letter-spacing : 50px; } .lettre3{ letter-spacing : 67px; } .lettre4{ letter-spacing : 109px; } .lettre5{ height : 1%; background : black; } </style> </head> <body> <table> <tr id="titre1"><td align="top"> blalabla</td><td id="photo">photo</td></tr> <tr valign="top"><td id="titre" class="lettre1" colspan="2">blabla</td></tr> <tr valign="top"><td id='annee'>2009 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>2008 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>2006 : </td><td>bla</td></tr> <tr align="top"><td id="titre" class="lettre2" colspan="2">blabla</td></tr> <tr valign="top"><td id='annee'>2008/2009 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2008 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2007 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Juin 2007 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2006 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Février 06 et 08 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Eté 2005 : </td><td>bla</td></tr> <tr valign="top"><td id='annee'>Hiver de 03 à 08 : </td><td>bla</td></tr> <tr valign="top"><td id="titre" class="lettre3" colspan="2">bla</td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla<br> bla<br> bla<br> bla<br> bla<br></td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla<br> bla<br> bla<br></td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla<br> bla<br> bla</td></tr> <tr><td id="titre" class="lettre4" colspan="2">bla</td></tr> <tr valign="top"><td id='annee'>bla</td><td>bla</td></tr> <tr><td class="lettre5" colspan="2"></td></tr> </table> </body> </html> -
#titre{
background-color: : #000000;
color : #ffffff; <=========== erreur! tu te contredi la!
font-weight : bold;
font-size : 20px;
height : 3%;
}
#titre1{
background-color: : #000000;
color : white <=====================la aussi !
height : 10%;
}
enlève le color:white
-
Non non pas de problème avec ça : color c'est pour la couleur du texte et background-color c'est pour la couleur du fond.
-
ben ça ne marche pas...
et pour info pour Versus92, en normal ça marche pas de problème, c'est pour l'impression que ça marche pas... -
je sais pas si ça va fonctionner mais essaie de créer un fichier css ( tu le nomme style.css par exemple)
et tu la reli à ta page html avec la balise <link> ,dans cette balise tu précise le type du media="all"