Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> 2 kolumny
slawo
post 29.06.2011, 13:12:55
Post #1





Grupa: Zarejestrowani
Postów: 184
Pomógł: 0
Dołączył: 11.01.2010
Skąd: Nowa Dęba

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


  1. #leftcol{
  2. width:500px;
  3. text-align:top;
  4. background-color: #ffffff;
  5. float:left;
  6. }
  7. #rightcol{
  8. float:right;
  9. width:300px;
  10. text-align:top;
  11. background-color: #ffffff;}



Witam, mam na stronie 2 kolumny. Z tym, że jedna jest dłuższa a jedna krótsza. Jak zrobić żęby te kolumny były równe? Niezależnie od tego w której kolumnie jest więcej treści.


--------------------
zpodziemia.pl - największa baza dobrych nielegali w POLSCE!
Go to the top of the page
+Quote Post
luckyps
post 29.06.2011, 13:32:59
Post #2





Grupa: Zarejestrowani
Postów: 153
Pomógł: 41
Dołączył: 28.06.2011
Skąd: Częstochowa

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


Mi do głowy przychodzi tylko rozwiazanie javascriptowe...
Pobrac wysokosc obu kolumn, sprawdzic ktora jest wieksza i ustawic wysokosc tej nizszej na wysokosc tej wyzszej.

  1. var leftcol = document.getElementById ("leftcol");
  2. var rightcol = document.getElementById ("rightcol");
  3.  
  4. leftHeight = leftcol.clientHeight;
  5. rightHeight = leftcol.clientHeight;
  6.  
  7. if(leftHeight > rightHeight) {
  8. rightcol.style.height = String(leftHeight)+"px";
  9. } else {
  10. leftcol.style.height = String(rightHeight)+"px";
  11. }

sprawdz czy dziala...
Go to the top of the page
+Quote Post
t_e_l
post 29.06.2011, 14:27:30
Post #3





Grupa: Zarejestrowani
Postów: 21
Pomógł: 5
Dołączył: 7.05.2011

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


Pierwsze lepsze z google...

Tutaj
albo
Tutaj

Go to the top of the page
+Quote Post
Adi32
post 29.06.2011, 15:38:37
Post #4





Grupa: Zarejestrowani
Postów: 348
Pomógł: 26
Dołączył: 8.10.2008
Skąd: Lublin

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


Parametr height by nie wystarczył?

Ewentualnie ująć je w diva o ustalonej wysokości a kolumnom nadać height: 100%;


--------------------
Wolałem języki z rodziny C ale poszedłem na łatwizne...
Go to the top of the page
+Quote Post
kujawska
post 3.07.2011, 23:26:14
Post #5





Grupa: Zarejestrowani
Postów: 116
Pomógł: 2
Dołączył: 19.02.2008

Ostrzeżenie: (50%)
XXX--


Spróbuj takiego rozwiązania:
  1. <div id=container" style="width:400px;background:silver;">
  2. <div id="lewy" style="background:yellow;width:200px;float:left;">
  3. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Proin nibh
  4. augue, suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam
  5. pellentesque aliquet tellus. Phasellus pharetra nulla ac diam. Quisque
  6. semper justo at risus. Donec venenatis, turpis vel hendrerit interdum,</p>
  7. </div>
  8. <div id="prawy" style="background:silver;width:200px;float:left;">
  9. <p>PRAWY</p>
  10. </div>
  11. <div id="stopka" style="clear:both;;width:100%;height:0px;">
  12. </div>
  13. </div>
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: 16.07.2025 - 05:27