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

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  [html& css] 3 DIV côte-à-côte (dont 2 en taille fixe)?

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[html& css] 3 DIV côte-à-côte (dont 2 en taille fixe)?

n°2063574
le_duc
PlaTyPuS
Posté le 15-03-2011 à 12:37:35  profilanswer
 

:hello:  
 
Est-il possible de mettre 3 div (ou span) côte à côte dans cette disposition
 [5px] [100%] [5px]
 
chaque [] représentant un DIV/SPAN ;).
 
Voilà le code que j'ai pour l'instant:

Code :
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. #1 {
  5. background: pink;
  6. width: 300px;
  7. height: 100px;
  8. }
  9. #2 {
  10. background: yellow;
  11. width: 50px;
  12. height: 20px;
  13. }
  14. #3 {
  15. background: green;
  16. width: 100%;
  17. height: 20px;
  18. }
  19. #4 {
  20. background: red;
  21. width: 50px;
  22. height: 20px;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <div id="1"><span id=2></span><span id=3></span><span id=4></span></div>
  28. </body>
  29. </html>


 
Merci pour votre aide.
PlaTyPuS

mood
Publicité
Posté le 15-03-2011 à 12:37:35  profilanswer
 

n°2063649
gatsu35
Blablaté par Harko
Posté le 15-03-2011 à 15:38:48  profilanswer
 

tu as vraiment besoin qu'ils fassent 5px de large ?  
tu mets une image pour la déco ? sinon utilises des bordures au mieux.
 
La solution idéale :  

Code :
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. #el1 {
  5. background: pink;
  6. width: 300px;
  7. height: 100px;
  8. }
  9. #el2 {
  10. background: yellow;
  11. width: 50px;
  12. height: 20px;
  13. float:left;
  14. }
  15. #el3 {
  16. display:block; overflow:hidden;
  17. height: 20px;
  18. }
  19. #el4 {
  20. background: red;
  21. width: 50px;
  22. height: 20px;
  23. float:right;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div id="el1">
  29. <span id="el2"></span>
  30. <span id="el4"></span>
  31. <span id="el3"></span>
  32. </div>
  33. </body>
  34. </html>


---------------
Blablaté par Harko

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

  [html& css] 3 DIV côte-à-côte (dont 2 en taille fixe)?

 

Sujets relatifs
[Script Batch] Trouver tous les fichiers dont la taille est sup à "X"adapté la taille d'un div contenant un include a sa page "appelée"
[Réglé] Caractères spéciaux BDD vers HTML[Débutant en HTML]Qui pourrait vérifier mon code svp?
Centrer DIV dans la fenetre (Chrome-FF : OK .:. IE7 : NOK)Disparition de la Div du bas lors de l'insertion d'un .swf
Actualiser une page HTML à la fin d'une video"re-executer " un script php via un bouton html
[HTML/CSS/Javascript/(php ?)] Widget sidebarapprentissage tableau html soucis
Plus de sujets relatifs à : [html& css] 3 DIV côte-à-côte (dont 2 en taille fixe)?


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