Print css

Fermé
powpowland Messages postés 395 Date d'inscription lundi 3 mars 2008 Statut Membre Dernière intervention 2 mars 2022 - 5 août 2009 à 17:33
XxIncontournablexX Messages postés 50 Date d'inscription mardi 4 août 2009 Statut Membre Dernière intervention 14 octobre 2009 - 6 août 2009 à 17:43
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...
A voir également:

15 réponses

Passarinho44 Messages postés 963 Date d'inscription mercredi 28 mai 2008 Statut Contributeur Dernière intervention 13 juin 2012 132
5 août 2009 à 17:35
Tu l'as mis sous quelle balise?
Le body, *, ou autre?
0
powpowland Messages postés 395 Date d'inscription lundi 3 mars 2008 Statut Membre Dernière intervention 2 mars 2022 20
5 août 2009 à 17:41
sur un id qui lui est sur un tr
0
Passarinho44 Messages postés 963 Date d'inscription mercredi 28 mai 2008 Statut Contributeur Dernière intervention 13 juin 2012 132
5 août 2009 à 17:52
Tu pourrais nous donner un bout de code pour nous montrer où est ton problème stp?
0
powpowland Messages postés 395 Date d'inscription lundi 3 mars 2008 Statut Membre Dernière intervention 2 mars 2022 20
5 août 2009 à 17:59
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 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>2008 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>2006 :&nbsp;</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 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2008 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2007 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Juin 2007 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2006 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Février 06 et 08 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2005 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Hiver de 03 à 08 :&nbsp;</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>
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Versus92 Messages postés 133 Date d'inscription dimanche 5 avril 2009 Statut Membre Dernière intervention 4 novembre 2009 1
5 août 2009 à 18:43
c'est normal qu'il est deux fois deux points ?

(l.24)
0
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
0
Versus92 Messages postés 133 Date d'inscription dimanche 5 avril 2009 Statut Membre Dernière intervention 4 novembre 2009 1
5 août 2009 à 19:33
non color c'est exclusivemment pour le text ...
0
Versus92 Messages postés 133 Date d'inscription dimanche 5 avril 2009 Statut Membre Dernière intervention 4 novembre 2009 1
5 août 2009 à 19:37
#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
0
powpowland Messages postés 395 Date d'inscription lundi 3 mars 2008 Statut Membre Dernière intervention 2 mars 2022 20
5 août 2009 à 20:26
ça change rien...
0
Passarinho44 Messages postés 963 Date d'inscription mercredi 28 mai 2008 Statut Contributeur Dernière intervention 13 juin 2012 132
6 août 2009 à 09:18
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.
0
Versus92 Messages postés 133 Date d'inscription dimanche 5 avril 2009 Statut Membre Dernière intervention 4 novembre 2009 1
6 août 2009 à 09:27
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 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>2008 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>2006 :&nbsp;</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 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2008 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2007 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Juin 2007 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2006 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Février 06 et 08 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Eté 2005 :&nbsp;</td><td>bla</td></tr>
    <tr valign="top"><td id='annee'>Hiver de 03 à 08 :&nbsp;</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>
0
XxIncontournablexX Messages postés 50 Date d'inscription mardi 4 août 2009 Statut Membre Dernière intervention 14 octobre 2009 2
6 août 2009 à 09:31
#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
0
Passarinho44 Messages postés 963 Date d'inscription mercredi 28 mai 2008 Statut Contributeur Dernière intervention 13 juin 2012 132
6 août 2009 à 09:40
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.
0
powpowland Messages postés 395 Date d'inscription lundi 3 mars 2008 Statut Membre Dernière intervention 2 mars 2022 20
6 août 2009 à 10:27
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...
0
XxIncontournablexX Messages postés 50 Date d'inscription mardi 4 août 2009 Statut Membre Dernière intervention 14 octobre 2009 2
6 août 2009 à 17:43
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"
0