Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1207 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  [CSS] Petit prob avec l'attribut font-size (Résolu)

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[CSS] Petit prob avec l'attribut font-size (Résolu)

n°1787827
Malta
Posté le 16-09-2008 à 20:36:19  profilanswer
 

Bonjour,
 
J'ai un fichier index.htm dans lequel un tableau à été automatiquement généré par un logiciel de découpe d'interfaces web.
 
Toutes les cellules sont de ce type là :
 

Code :
  1. <td rowspan=3 background="images/r3_c7.jpg" width=19 height=100 border=0></td>


 
Je commence mon fichier CSS par les attributs du body en mettant :
 

Code :
  1. body {
  2. color: white;
  3. background-color: #18233E;
  4. }


 
Je constate que la couleur de fond est bien prise en compte, ainsi que le texte que j'ai inséré un peu partout dans les cellules, qui s'affiche bien en [U]blanc[/U].
 
J'ajoute ensuite l'attribut font-size de la manière suivante :
 

Code :
  1. body {
  2. color: white;
  3. font-size:6px;
  4. background-color: #18233E;
  5. }


 
Mais là, rien à faire, la taille de police ne change pas.
j'ai essayer en px, en pt, en XX-small etc..., rien à faire, la taille de police reste toujours la même, la taille standard.
 
Je me dis que ça doit sûrement être un détail de #M!@#!!@ que je ne connais pas...
Quelqu'un aurait une idée ?


Message édité par Malta le 18-09-2008 à 18:50:25
mood
Publicité
Posté le 16-09-2008 à 20:36:19  profilanswer
 

n°1787849
Dan_A
Posté le 16-09-2008 à 21:29:50  profilanswer
 

Avec quel navigateur ?
Quel est le texte qui s'affiche? Il n'apparaît pas dans le code cité.
Quelle police ?
Les petites tailles de caractères sont-elles autorisées dans les options du navigateur ?

n°1787853
Malta
Posté le 16-09-2008 à 21:44:55  profilanswer
 

Avec la dernière version de Firefox 3.0.1
Etant donné que je viens de creer les pages, le texte, c'est "bla bla bla".
 
La police est celle par défaut, je n'ai rien précisé. La seule présence de l'attribut "font" est dans le BODY du css montré ci-dessus, et qui ne fonctionne donc pas.
 
Les petites tailles autorisés ? Oui, je suppose, en tout cas je vois beaucoup de tailles différentes sur n'importe quel site que je visite...
 
Merci pour ton aide !


Message édité par Malta le 16-09-2008 à 21:45:31
n°1787936
Dan_A
Posté le 17-09-2008 à 09:26:33  profilanswer
 

Peux-tu donner un lien vers un exemple de page qui pose problème ?

n°1788785
Malta
Posté le 18-09-2008 à 17:58:42  profilanswer
 

Voici le code complet.
A titre d'info :
- la page index est quasi-vide, il n'y a qu'un tableau d'images.
- Les cellules "TDspacer" contiennent le fameux pixel transparent (1x1) nécessaire dans la découpe d'interface web.
- La balise span que je viens de rajouter pour le titre n'a aucun effet non plus...
 
La page index.htm

Code :
  1. <html>
  2. <head>
  3. <title>index.jpg</title>
  4. <link rel="stylesheet" type="text/css" href="./style.css">
  5. </head>
  6. <body>
  7. <table border=0 cellpadding=0 cellspacing=0 width=1400>
  8.   <tr>
  9.    <td class=TDspacer     width=177 height=1></td>
  10.    <td class=TDspacer     width=129 height=1></td>
  11.    <td class=TDspacer     width=140 height=1></td>
  12.    <td class=TDspacer     width=23 height=1></td>
  13.    <td class=TDspacer     width=13 height=1></td>
  14.    <td class=TDspacer     width=367 height=1></td>
  15.    <td class=TDspacer     width=19 height=1></td>
  16.    <td class=TDspacer     width=81 height=1></td>
  17.    <td class=TDspacer     width=164 height=1></td>
  18.    <td class=TDspacer     width=287 height=1></td>
  19.    <td class=TDspacer     width=1  height=1></td>
  20.   </tr>
  21.   <tr>
  22.    <td class=TDspacer rowspan=13   width=177 height=800></td>
  23.    <td      colspan=3 width=292 height=54 background="images/r1_c2.jpg"></td>
  24.    <td      colspan=2 width=380 height=54 background="images/r1_c5.jpg"></td>
  25.    <td    rowspan=2 colspan=3 width=264 height=126 background="images/r1_c7.jpg"></td>
  26.    <td class=TDspacer rowspan=13   width=287 height=800></td>
  27.    <td class=TDspacer     width=1  height=54></td>
  28.   </tr>
  29.   <tr>
  30.    <td    rowspan=3 colspan=3 width=292 height=119 background="images/r2_c2.jpg"></td>
  31.    <td   rowspan=2 colspan=2 width=380 height=108>
  32. <a href="./"><img src="images/r2_c5.jpg" border=0></a>
  33.    </td>
  34.    <td       width=1  height=72 background="images/spacer.gif"></td>
  35.   </tr>
  36.   <tr>
  37.    <td   rowspan=3   width=19 height=100 background="images/r3_c7.jpg"></td>
  38.    <td   rowspan=3 colspan=2 width=245 height=100 background="images/r3_c8.jpg" valign="top">
  39. Mon compte<br>Mon groupe<br>Info perso
  40.    </td>
  41.    <td       width=1  height=36 background="images/spacer.gif"></td>
  42.   </tr>
  43.   <tr>
  44.    <td     colspan=2 width=380 height=11 background="images/r4_c5.jpg"></td>
  45.    <td class=TDspacer     width=1  height=11></td>
  46.   </tr>
  47.   <tr>
  48.    <td     colspan=3 width=292 height=53 background="images/r5_c2.jpg"></td>
  49.    <td       width=13 height=53 background="images/r5_c5.jpg"></td>
  50.    <td       width=367 height=53 background="images/r5_c6.jpg" valign="top">
  51. <span class="title">ICI LE TITRE</span>
  52.    </td>
  53.    <td class=TDspacer     width=1  height=53></td>
  54.   </tr>
  55.   <tr>
  56.    <td   rowspan=2   width=129 height=11 background="images/r6_c2.jpg"></td>
  57.    <td   rowspan=2   width=140 height=11 background="images/r6_c3.jpg" valign="top">
  58. Menu 1<br>Menu 2
  59.    </td>
  60.    <td   rowspan=2   width=23 height=11 background="images/r6_c4.jpg"></td>
  61.    <td   rowspan=2   width=13 height=11 background="images/r6_c5.jpg"></td>
  62.    <td   rowspan=5 colspan=3 width=467 height=11 background="images/r6_c6.jpg" valign="top">
  63. Contenu : bla bla bla bla bla bla bla bla bla bla bla bla<br>bla bla bla bla bla bla bla bla bla bla bla bla<br>
  64. test<br>
  65.    </td>
  66.    <td   rowspan=5   width=164 height=11 background="images/r6_c9.jpg"></td>
  67.    <td class=TDspacer     width=1  height=11></td>
  68.   </tr>
  69.   <tr>
  70.    <td class=TDspacer     width=1  height=172></td>
  71.   </tr>
  72.   <tr>
  73.    <td       width=129 height=23 background="images/r8_c2.jpg"></td>
  74.    <td       width=140  height=23 background="images/r8_c3.jpg"></td>
  75.    <td       width=23 height=23 background="images/r8_c4.jpg"></td>
  76.    <td       width=13 height=23 background="images/r8_c5.jpg"></td>
  77.    <td class=TDspacer     width=1  height=23></td>
  78.   </tr>
  79.   <tr>
  80.    <td   rowspan=2 colspan=4 width=305 height=6 background="images/r9_c2.jpg"></td>
  81.    <td class=TDspacer     width=1  height=6></td>
  82.   </tr>
  83.   <tr>
  84.    <td class=TDspacer     width=1  height=59></td>
  85.   </tr>
  86.   <tr>
  87.    <td rowspan=2 colspan=4   width=305 height=245 background="images/r11_c2.jpg"></td>
  88.    <td   colspan=3   width=467 height=194 background="images/r11_c6.jpg"></td>
  89.    <td       width=164 height=194 background="images/r11_c9.jpg"></td>
  90.    <td class=TDspacer     width=1  height=194></td>
  91.   </tr>
  92.   <tr>
  93.    <td   colspan=3   width=467 height=51 background="images/r12_c6.jpg" valign="top" align="center">
  94. Designed & Created by Malta © in 2008
  95.    </td>
  96.    <td       width=164 height=51 background="images/r12_c9.jpg"></td>
  97.    <td class=TDspacer     width=1  height=51></td>
  98.   </tr>
  99.   <tr>
  100.    <td class=TDspacer colspan=8   width=936 height=58></td>
  101.    <td class=TDspacer     width=1  height=58></td>
  102.   </tr>
  103. </table>
  104. </body>
  105. </html>


 
Le fichier css :
 

Code :
  1. body
  2. {
  3. color: white;
  4. font-size:6px;
  5. background-color: #18233E;
  6. }
  7. TDspacer
  8. {
  9. background-image:url(images/spacer.gif);
  10. }
  11. title
  12. {
  13. font-size:14px;
  14. font-weight:bold;
  15. }
  16. a:link {
  17. text-decoration:none;
  18. color:white;
  19. }
  20. a:visited {
  21. text-decoration:none;
  22. color:white;
  23. }
  24. a:hover , a:active {
  25. text-decoration:none;
  26. color:white;
  27. }


 
Voilà, je rappelle le problème :
- Tout ce qui concerne le Font ne s'affiche pas, sauf la couleur...

n°1788809
Dan_A
Posté le 18-09-2008 à 18:39:12  profilanswer
 

Il faut utiliser un code valide (html et css) et donc ajouter un doctype pour que ça marche.

n°1788815
gatsu35
Blablaté par Harko
Posté le 18-09-2008 à 18:47:37  profilanswer
 

et ensuite éviter la mise en page en tableau. Le code que tu viens de filer date des années 1990

n°1788818
Malta
Posté le 18-09-2008 à 18:49:48  profilanswer
 

euh... après un petit tour rapide sur Google, j'ai rajouter un doctype de type "transitionnal", et tout marche...
 
J'ai jamais compris à quoi servait "cette première ligne inutile qu'on voit partout"... J'ai appris quelque chose. ^^
 
Merci beaucoup Dan_A !!


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  [CSS] Petit prob avec l'attribut font-size (Résolu)

 

Sujets relatifs
Menu html CSS (ul li) [resolu][Résolu]Pb récupération plusieurs valeurs d'un formulaire dans un mail
Question style de lien aux pros du HTML/CSSLes fichiers de style CSS ne se chargent pas!
[Résolu] Installation d'imprimante réseau depuis une page web[RESOLU] Exposant en php
[RESOLU] Recherche code touche enfoncé, pour du javascript[CSS] hauteur d'un tableau sous IE
[resolu] liens hypertexte inactif sous Mozilla 
Plus de sujets relatifs à : [CSS] Petit prob avec l'attribut font-size (Résolu)


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR