Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [xhtml] Wyrównanie w pionie do dołu.
hzl_91
post
Post #1





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 28.03.2006
Skąd: Częstochowa

Ostrzeżenie: (10%)
X----


Witam. Dzisiaj budując swój them na DIV 'ach napotkałem problem tzn. kiedy chcąc żeby tekst był wyrównany do dołu w jednym z divów nie mogłem tego uzyskać żadną metodą. Nie wiem, czemu. Obniżał się, ale nie do końca.

To mój kod css:
Cytat
#top_table_login {
border: 0px;
width: 100%;
height: 50%;
vertical-align: bottom;
}


Dlaczego nie wyrównuje do dołu?

Ten post edytował hzl_91 6.01.2007, 11:01:39
Go to the top of the page
+Quote Post
hzl_91
post
Post #2





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 28.03.2006
Skąd: Częstochowa

Ostrzeżenie: (10%)
X----


Ale ja nie chce centrowania. Tylko żeby mieć tekst u dołu komórki.
Go to the top of the page
+Quote Post
cadavre
post
Post #3





Grupa: Zarejestrowani
Postów: 472
Pomógł: 7
Dołączył: 7.12.2005
Skąd: Gliwice

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


  1. p.komunikat {
  2. height: 10em;
  3. display:table;
  4. vertical-align:middle;
  5. }
Masz przykład. Przenosisz tylko do swojego kodu i zamiast middle dajesz bottom. Gotowe.
Go to the top of the page
+Quote Post
hzl_91
post
Post #4





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 28.03.2006
Skąd: Częstochowa

Ostrzeżenie: (10%)
X----


Nie działa. Zrobiłęm tak:
  1. #top_table_login {
  2. border: 0px;
  3. width: 100%;
  4. height: 50%;
  5. display:table;
  6. vertical-align:bottom;
  7. }
Go to the top of the page
+Quote Post
cadavre
post
Post #5





Grupa: Zarejestrowani
Postów: 472
Pomógł: 7
Dołączył: 7.12.2005
Skąd: Gliwice

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


O ile się nie mylę element nadrzędny (ten który zawiera diva) powinien mieć display:table;, a ten który ma być wyśrodkowany display:table-cell;. Tak jak tutaj: http://riddle.pl/-/xhtml/css-centering/vert-03.html z tym, że bottom.
Go to the top of the page
+Quote Post
hzl_91
post
Post #6





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 28.03.2006
Skąd: Częstochowa

Ostrzeżenie: (10%)
X----


Element div:
  1. <!-- Top table -->
  2. <div id="top_table">
  3. <div id="top_table_title">
  4. <h1>Site title</h1>
  5. <h2>You little text about You site.</h2>
  6. </div>
  7. <div id="top_table_login">
  8. <h3><a href="login/logout.html">Wyloguj [ <b>hzl_91</b> ]</a> | <a href="ucp.html">Twoje konto</a></h3>
  9. </div>
  10. </div>
  11. <!-- End top table -->


CSS:
Cytat
#top_table {
border: 0px;
margin: auto;
padding: 0;
background: url(images/top.jpg) repeat-x;
width: 100%;
height: 166px;
}
#top_table_title {
border: 0px;
width: 100%;
height: 50%;
text-align: left;
}
#top_table_login {
border: 0px;
width: 100%;
height: 50%;
display:table;
vertical-align:bottom;
}


I co tu jest źle?

Pomocy!

Ten post edytował hzl_91 6.01.2007, 14:15:04
Go to the top of the page
+Quote Post
cadavre
post
Post #7





Grupa: Zarejestrowani
Postów: 472
Pomógł: 7
Dołączył: 7.12.2005
Skąd: Gliwice

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


Masz dwa elementy w jednym divie i tylko jednego chcesz umieścić na dole? Nie da się tak.

Zrób:
  1. <div id="top_table">
  2. <div id="top_table_title">
  3. <h1>Site title</h1>
  4. <h2>You little text about You site.</h2>
  5. </div>
  6. </div>
  7. <div id="other_div"
  8. <div id="top_table_login">
  9. <h3><a href="login/logout.html">Wyloguj [ <b>hzl_91</b> ]</a> | <a href="ucp.html">Twoje konto</a></h3>
  10. </div>
  11. </div>


i CSS:
  1. #top_table {
  2. border: 0px;
  3. margin: auto;
  4. padding: 0;
  5. background: url(images/top.jpg) repeat-x;
  6. width: 100%;
  7. height: 166px;
  8. }
  9. #top_table_title {
  10. border: 0px;
  11. width: 100%;
  12. height: 50%;
  13. text-align: left;
  14. }
  15. #other_div {
  16. height:100%;
  17. display:table;
  18. }
  19. #top_table_login {
  20. border: 0px;
  21. width: 100%;
  22. height: 50%;
  23. display:table-cell;
  24. vertical-align:bottom;
  25. }


EDIT: Tylko naturalnie sobie atrybut height dla #other_div wpisz odpowiedni.

Ten post edytował cadavre 6.01.2007, 18:44:16
Go to the top of the page
+Quote Post
pieto
post
Post #8





Grupa: Zarejestrowani
Postów: 227
Pomógł: 1
Dołączył: 12.05.2002
Skąd: gdańsk

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


W IE - ne działa - jakas rada ?
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: 19.09.2025 - 19:47