Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS]Automatycznie rozciągający się div, Rozciąganie diva w zależności od zawartości
kristos44
post 21.02.2010, 13:50:11
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 1
Dołączył: 6.04.2009
Skąd: łdz

Ostrzeżenie: (0%)
-----


Potrzebuję zrobić trzy kolumnowy układ strony plus nagłówek i stopka. Kod html wygląda tak:
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  4. <link rel="stylesheet" href="style.css" type="text/css"/>
  5. </head>
  6. <body>
  7. <div id="wrapper">
  8. <div id="top">
  9. top
  10. </div>
  11. <div id="menu">
  12. menu
  13. </div>
  14. <div id="content">
  15. <div id="left">
  16. left
  17. </div>
  18. <div id="center">
  19. center</br>
  20. center</br>
  21. center</br>
  22. center</br>
  23. center</br>
  24. center</br>
  25. center</br>
  26. center</br>
  27. center</br>
  28. center</br>
  29. </div>
  30. <div id="right">
  31. right</br>
  32. right</br>
  33. right</br>
  34. right</br>
  35. right</br>
  36. </div>
  37. </div>
  38. <div id="clear"></div>
  39. <div id="footer">
  40. footer
  41. </div>
  42. </div>
  43. </body>
  44. </html>

Do tego plik css:
  1. html, body, div {
  2. margin: 0;
  3. padding: 0;
  4. }
  5.  
  6. #wrapper {
  7. margin: 0 auto;
  8. width: 1000px
  9. }
  10.  
  11. #top {
  12. background: blue;
  13. height: 150px
  14. }
  15.  
  16. #menu {
  17. background: yellow
  18. }
  19.  
  20. #content {
  21. background: red;
  22. width: 1000px;
  23. }
  24.  
  25. #left {
  26. width: 200px;
  27. float: left
  28. }
  29.  
  30. #center {
  31. width: 600px;
  32. float: left
  33. }
  34.  
  35. #right {
  36. width: 200px;
  37. float: left
  38. }
  39.  
  40. #clear {
  41. clear: both;
  42. }
  43.  
  44. #footer {
  45. background: orange;
  46. width: 1000px
  47. }


Chciałbym aby div content rozszerzał się w dół w zależności od wysokości divów w nim zawartych. W zasadzie w zależności od wysokości diva center, gdyż jest to div z treścią i z reguły będzie najdłuższy.


--------------------
kristos.pl
Go to the top of the page
+Quote Post
skowron-line
post 21.02.2010, 13:52:44
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

Ostrzeżenie: (0%)
-----


Najprościej będzie to chyba zrobić w JS.


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 08:39