Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> automatycznie dopasowana wysokosc diva
elem323
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 24.07.2009

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


Witam, tak jak w temacie.. nie wiem czy znajdzie sie odwazny zeby sie z tym zmiezyc, bo problem raczej ciezki. Ponizej kod. dziala w IE6, FF3, nie dizla w IE7, IE8, Safari4


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  3. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  5.  
  6. </head>
  7.  
  8. <div style="background:#99FF00; width:400px; overflow:hidden; height:100%; display:table">
  9.  
  10. <div style="float:left; width:200px; display:table; height:100%; background:#eaeaea;">
  11. This design uses a defined body height of 100% which allows setting the contained left and right divs at 100% height.
  12. </div>
  13. <div style="float:left; width:200px; display:table; overflow:hidden; background:#990000">
  14. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  15. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  16. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  17. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  18. </div>
  19.  
  20. </div>
  21.  
  22. </body>
  23. </html>
Go to the top of the page
+Quote Post
drake88
post
Post #2





Grupa: Zarejestrowani
Postów: 283
Pomógł: 15
Dołączył: 22.03.2009
Skąd: Bytów

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


Zamień height: 100% na height: auto
Go to the top of the page
+Quote Post
elem323
post
Post #3





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 24.07.2009

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


niestety az tak proste to nie jest ..jak dam height:auto, to juz niegdzie nie dziala
Go to the top of the page
+Quote Post
Daiquiri
post
Post #4





Grupa: Administratorzy
Postów: 1 552
Pomógł: 211
Dołączył: 7.07.2009
Skąd: NJ




dodaj position:fixed; w zielonym divie (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
elem323
post
Post #5





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 24.07.2009

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


chlopaki, nie robmy zgadywanki, no baredzo was prosze. Najpierw sprawdzic potem odpowiedziec.
Ale dzieki kazdemu ktos sprobuje.
Go to the top of the page
+Quote Post
Daiquiri
post
Post #6





Grupa: Administratorzy
Postów: 1 552
Pomógł: 211
Dołączył: 7.07.2009
Skąd: NJ




Poprawiłam tak, żeby działało tak samo pod IE6 jak i FF3 (u mnie różnica polega na tym, że pod IE zielony div rozciąga się do końca strony, zaś w FF jest niewidoczny). Więc uwierz mi, że nie strzelam, tylko sprawdzałam. Wklej chociaż prowizorycznie co chcesz osiągnąć np. za pomocą *jpg.
Go to the top of the page
+Quote Post
elem323
post
Post #7





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 24.07.2009

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


dokladnie to co jest na FF3, tzn, w czerwonego Dive wpisuje tyle tekstu ile tylko chce, a div szary zawsze doasuje swoja wysokosc do wysokosci diva czerwonego
Go to the top of the page
+Quote Post
Daiquiri
post
Post #8





Grupa: Administratorzy
Postów: 1 552
Pomógł: 211
Dołączył: 7.07.2009
Skąd: NJ




POD IE8 działa (nie wiem jak Safari i IE7) - nie mam możliwości sprawdzenia.

  1. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  2. <style media="screen" type="text/css">
  3. /* <!-- */
  4. body {
  5. margin:0;
  6. padding:0;
  7. }
  8.  
  9.  
  10. #container2 {
  11. clear:left;
  12. float:left;
  13. width:100%;
  14. overflow:hidden;
  15. background:#990000;
  16. }
  17. #container1 {
  18. float:left;
  19. width:100%;
  20. position:relative;
  21. right:50%;
  22. background:#eaeaea;
  23. }
  24. #col1 {
  25. float:left;
  26. width:46%;
  27. position:relative;
  28. left:52%;
  29. overflow:hidden;
  30. }
  31. #col2 {
  32. float:left;
  33. width:46%;
  34. position:relative;
  35. left:56%;
  36. overflow:hidden;
  37. }
  38.  
  39. </style>
  40. </head>
  41.  
  42. <body>
  43.  
  44. <div id="container2">
  45. <div id="container1">
  46. <div id="col1">
  47.  
  48. This design uses a defined body height of 100% which allows setting the contained left and right divs at 100% height.
  49.  
  50. </div>
  51. <div id="col2">
  52.  
  53. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  54. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  55. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  56. contained left and right divs at 100% height. This design uses a defined body height of 100% which allows setting the
  57.  
  58. </div>
  59. </div>
  60. </div>
  61.  
  62.  
  63.  
  64.  
  65. </body>
  66. </html>


Polecam! (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował Daiquiri 24.07.2009, 10:44:56
Go to the top of the page
+Quote Post
elem323
post
Post #9





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 24.07.2009

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


Daiquiri,naprawde dobry jestes.. musisz miec niezle doswiadczenie. Wielkie dzieki, pomogles (IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif) !
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 3.10.2025 - 15:06