Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CSS][HTML] Jak ułożyć divy tak jak chcę? :<
Flapper
post
Post #1





Grupa: Zarejestrowani
Postów: 56
Pomógł: 0
Dołączył: 10.04.2007
Skąd: znienacka.

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


No właśnie próbowałem różnych metod ustawiania ale nijak mi nie wychodzi jak chcę...
Mam taki arkusz:
Kod
html, body {
    background-color: #000000;
    color: #18ff00;
    margin: 0;
    padding: 0;
    font-family: System, Terminal;
}

#top {
    width: 1007px;
}

#top1 {
    position: relative;
    float: left;
    background: url(images/1.gif);
    width: 194px;
    height: 216px;
    overflow: hidden;
}
#top2 {
    position: relative;
    background: url(images/2.gif);
    width: 588px;
    height: 216px;
    overflow: hidden;
}
#top3 {
    position: relative;
    background: url(images/3.gif);
    width: 225px;
    height: 716px;
    overflow: hidden;
}

#mid1 {
    position: relative;
    float: left;
    background: url(images/4.gif);
    width: 194px;
    height: 500px;
    overflow: hidden;
}

#mid2 {
    position: relative;
    background: url(images/5.gif);
    width: 588px;
    height: 500px;
    overflow: hidden;
}

#stopka {
    position: relative;
    background: url(images/6.gif);
    width: 1007px;
    height: 39px;
    overflow: hidden;
}


I chciałbym żeby wyglądało to mniej więcej tak:
top1 top2 top3
mid1 mid2 top3
stopka stopka

przy czym te podwójne top3 i stopki mają być pojedynczymi divami.
I nie mam pojęcia jak te divy poukładać w HTML'u i co im w stylu wpisać żeby się tak ułożyło.
Męczę to od wczoraj ale samemu mi się to chyba nie uda. (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) Liczę na waszą pomoc, z góry dzięki.

Ten post edytował Flapper 27.04.2008, 21:27:28
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
batman
post
Post #2





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




Wersja 1:
  1. #main div {
  2. border: 1px solid red;
  3. }
  4.  
  5. #center, #right {
  6. float: left;
  7. }
  8.  
  9. #footer {
  10. clear: left;
  11. }
  12.  
  13. <div id="main">
  14. <div id="center">
  15. <div id="top">aaaaa</div>
  16. <div id="middle">bbbbb</div>
  17. </div>
  18. <div id="right">ccccc</div>
  19. <div id="footer">ddddd</div>
  20. </div>


Wersja 2:
Ten sam kod HTML.
  1. #main div {
  2. border: 1px solid red;
  3. }
  4.  
  5. #center {
  6. float: left;
  7. width: 500px;
  8. }
  9.  
  10. #main #right {
  11. margin-left: 500px;
  12. }
  13.  
  14. #footer {
  15. clear: left;
  16. }
  17. </style>


Oczywiście musisz usunąć obramowanie oraz ustawić odpowiednią szerokość div-ów.
A jeśli chcesz uzyskać efekt, że div "top3" będzie rozszerzał się razem z div-ami "top" i "middle", to napisz. Coś się wymyśli (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post

Posty w temacie


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: 8.10.2025 - 00:05