Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][CSS]Problem z Divami
MnicH.
post
Post #1





Grupa: Zarejestrowani
Postów: 134
Pomógł: 4
Dołączył: 16.02.2007
Skąd: Leszno

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


Witam,
mam mały problem z divami. Mam taki kod CSS:
Kod
.miasta{
   position: relative;
   left: 10%;
   top: 10px;
   width: 802px;
   height: auto;
}

.miasta_up_left{
    float: left;
    background-image: url(images/img_29.png);
    height: 25px;
    width: 15px;
}

.miasta_up_center{
    float: center;
    background-image: url(images/img_22.png);
    height: 25px;
    width: 768px;
}

.miasta_up_right{
    float: right;
    background-image: url(images/img_56.png);
    height: 25px;
    width: 15px;
}

.miasta_ce_left{
    float: left;
    background-image: url(images/img_35.png);
    height: 14px;
    width: 117px;    
}

.miasta_ce_center{
    float: center;
    background-image: url(images/img_30.png);
    height: 117px;
    width: 768px;    
}

.miasta_ce_right{
    float: right;
    background-image: url(images/img_21.png);
    height: 14px;
    width: 117px;    
}

.miasta_down_left{
    float: left;
    background-image: url(images/img_31.png);
    height: 15px;
    width: 10px;    
}

.miasta_down_center{
    float: center;
    background-image: url(images/img_33.png);
    height: 10px;
    width: 768px;    
}

.miasta_down_right{
    float: right;
    background-image: url(images/img_32.png);
    height: 14px;
    width: 10px;    
}


i tak w html
  1. <div class="miasta">
  2. <div class="miasta_up_left"></div><div class="miasta_up_center"></div><div class="miasta_up_right"></div>
  3. <div class="miasta_ce_left"></div><div class="miasta_ce_center"></div><div class="miasta_ce_right"></div>
  4. <div class="miasta_down_left"></div><div class="miasta_down_center"></div><div class="miasta_down_right"></div>
  5. </div>


I zamiast wyswietlac mi w ukladzie:
[___up_left__][__up_center__][__up_right_]
[___ce_left__][__ce_center__][__ce_right _]
[_down_left__][_down_center][down_right_]

To wyświetla mi tak:

Co robie źle?


--------------------
"This isn't Miami..., This isn't Music! This is power!!"
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 5)
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Ech.. Za duzo pisania..
http://kurs.browsehappy.pl/Kurs/Spis
http://www.webcredible.co.uk/user-friendly...ers-boxes.shtml


--------------------
Go to the top of the page
+Quote Post
MnicH.
post
Post #3





Grupa: Zarejestrowani
Postów: 134
Pomógł: 4
Dołączył: 16.02.2007
Skąd: Leszno

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


Hmm... Sory za takie coś, ale czy mógłby ktoś to poprawić żeby działało?


--------------------
"This isn't Miami..., This isn't Music! This is power!!"
Go to the top of the page
+Quote Post
Lion_87
post
Post #4





Grupa: Zarejestrowani
Postów: 850
Pomógł: 120
Dołączył: 15.02.2007
Skąd: Łódź

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


Po pierwsze obejmujesz wszystko w #miasta width 802px a suma #miasta_ce_left #miasta_ce_center #miasta_ce_right? Policz !
Po drugie clear może Tobie pomoże.

Ten post edytował Lion_87 23.01.2009, 18:51:36
Go to the top of the page
+Quote Post
wookieb
post
Post #5





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Podam ci inna metode. Jak nie bedziesz w stanie jej zaimplementowac to niestety..
Kod
<div id="top_left">
<div id="top_right">
<div id="top_bg">
</div>
</div>
</div>


Kod
#top_left
{
padding-left: 10px; // szerokosc obrazka tla
background:url (obrazek_tla_lewego) no-repeat;
}

#top_right
{
padding-right: 10px;
background: url(obrazek_tla_prawego) no-repeat right;
}

#top_bg
{
background: url(obrazek_tla_glownego);
}

To chyba najlepsza metoda jaka znam i dziala wszedzie.


--------------------
Go to the top of the page
+Quote Post
black_alexis
post
Post #6





Grupa: Zarejestrowani
Postów: 41
Pomógł: 3
Dołączył: 2.01.2009
Skąd: Kraków

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


nie ma takiej wartości jak float: center;

jeśli już to ustaw sobie divy tak jak idą po kolei:
div1{

}
div2{

}
...
div9{

}
Nie wiem ile masz tam divów i najlepiej ustawiać sobie dla float'a wartości:
float: left; a ostatni czyli ten najbliżej prawej strony: float: right;

[div 1 float:left;][div 2 float:left;][div3 float:right;]
[div 4 float:left;][div 5 float:left;][div6 float:right;]
[div 7 float:left;][div 8 float:left;][div9 float:right;]

jeśli dalej nie kapujesz to pisz: gg6822742

pamiętaj tylko, żeby za koleją ustawiać divy...


--------------------
http://design-solution.pl/

Jeżeli zdarzy się taka sytuacja, ze Ci pomogę, zaklikaj że to zrobiłam :)
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 Aktualny czas: 21.08.2025 - 18:52