Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS]Img obok siebie
--gość--
post
Post #1





Goście







Witam,
mam problem. Mam dwa obrazki, razem zajmuja rowne 800px ( zalozmy ze jeden ma 400szer i drugi tyle samo). Chcialbym w css ustawic je obok siebie, wiec zrobilem 2 klasy:
  1. #panel {
  2. background-image:url(images/ost.png);
  3. width:481px;
  4. height:140px;
  5. align:center;
  6. margin: 11px 0 0 0;
  7. padding: 0;
  8. }
  9. #panel2 {
  10. background-image:url(images/wit.png);
  11. width:319px;
  12. height:141px;
  13. vertical-align: top;
  14. }
  15.  
  16. Ale one sie wyswietlaja jeden pod drougim :/
  17. Kod, ktorym wyswietlam:
  18. [html]
  19. <div id=\"panel\">Trsc na panelu nr 1</div><div id=\"panel2\">Tresc na panelu nr 2</div>

Jak to zrobic zeby obrazki byly na tej samej wysokosci obok siebie?
Go to the top of the page
+Quote Post
l0ud
post
Post #2





Grupa: Zarejestrowani
Postów: 1 387
Pomógł: 273
Dołączył: 18.02.2008

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


Najprościej... nadaj jednemu float:left; a drugiemu float:right...
Go to the top of the page
+Quote Post
-Gość-
post
Post #3





Goście







Wtedy reszta strony sie dziwnie rozjezdza
Go to the top of the page
+Quote Post
-Gość-
post
Post #4





Goście







A dokladniej mowiac menu pojawia sie pomiedzy nimi. Jak je ustawic zeby byly obok siebie, bo jeden jest calkiem po lewej a drugi po prawej.
Go to the top of the page
+Quote Post
l0ud
post
Post #5





Grupa: Zarejestrowani
Postów: 1 387
Pomógł: 273
Dołączył: 18.02.2008

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


Element po tych warstwach powinien mieć clear:both , aby nie wyjeżdżały poza niego.
Go to the top of the page
+Quote Post
-Gość-
post
Post #6





Goście







Ok, dziala ale...
Jeden jest calkiem po lewej a drugi calkiem po prawej. Jak je polaczyc? Zeby byly na srodku.. ( center nie dziala)
Go to the top of the page
+Quote Post
kusiu
post
Post #7





Grupa: Zarejestrowani
Postów: 163
Pomógł: 10
Dołączył: 24.01.2006

Ostrzeżenie: (30%)
XX---


Cytat(-gość- @ 22.03.2008, 12:47:05 ) *
Witam,
mam problem. Mam dwa obrazki, razem zajmuja rowne 800px ( zalozmy ze jeden ma 400szer i drugi tyle samo). Chcialbym w css ustawic je obok siebie, wiec zrobilem 2 klasy:
  1. #panel {
  2. background-image:url(images/ost.png);
  3. width:481px;
  4. height:140px;
  5. align:center;
  6. margin: 11px 0 0 0;
  7. padding: 0;
  8. }
  9. #panel2 {
  10. background-image:url(images/wit.png);
  11. width:319px;
  12. height:141px;
  13. vertical-align: top;
  14. }
  15.  
  16. Ale one sie wyswietlaja jeden pod drougim :/
  17. Kod, ktorym wyswietlam:
  18. [html]
  19. <div id=\"panel\">Trsc na panelu nr 1</div><div id=\"panel2\">Tresc na panelu nr 2</div>

Jak to zrobic zeby obrazki byly na tej samej wysokosci obok siebie?


vertical-align: top; w <DIV> (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
l0ud
post
Post #8





Grupa: Zarejestrowani
Postów: 1 387
Pomógł: 273
Dołączył: 18.02.2008

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


No nie wiem... Umieść je w jeszcze jednym divie, który będzie miał określoną szerokość.
Go to the top of the page
+Quote Post
-Gość-
post
Post #9





Goście







kusiu - to dalem przez przypadek, teraz jak robie to bez tego.
lOud - nie dziala
Go to the top of the page
+Quote Post
nez
post
Post #10





Grupa: Zarejestrowani
Postów: 7
Pomógł: 1
Dołączył: 14.03.2006

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


Kod
<style type="text/css">
div#container {
  width: 800px;
/*  margin: 0 auto;  to jeśli całość chcesz wyśrodkować w przeglądarce */
}
</style>

<div id="container">
<div id=\"panel\">Trsc na panelu nr 1</div><div id=\"panel2\">Tresc na panelu nr 2</div>
</div>



pozdr.
nez
Go to the top of the page
+Quote Post
-Gość-
post
Post #11





Goście







Thx,
działa (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Pozdro (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

PS. Dałbym ci: Pomógł ale nie mogę :/
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: 14.09.2025 - 22:24