Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [css] divy obok siebie = brak obramowania
wujek_bogdan
post
Post #1





Grupa: Zarejestrowani
Postów: 76
Pomógł: 0
Dołączył: 8.03.2008

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


chcę aby divy zanjdujące się wewnątrz diva "containter" byłu obramowane ramką o szerokości 1px;
wszystko jest ok dopóki nie dodam float:left; (divy mają być obok siebie a nie jeden pod drugim).
gdy dodaje float:left; ramka zamiast obejmować divy obejmuje tylko jeden górny piksel :/

css wygląda tak:
Kod

#container {
margin-top: 10px;
margin: 0px auto;
width: 965px;
height: auto;
padding:0px;
border-style: solid;
border-color: #000;
border-width: 1px;
}

#left {
float:left;
text-align: left;
width: 200px;
border-style: solid;
border-top-width: 0px;
border-left-width: 1px;
border-right-width: 0px;
border-bottom-width: 0px;
   }

#center {
float:right;
text-align: left;
   }

#right {
float:right;
width: 200px;
   }


a html tak:
Kod
<div id="container">

     <div id="left"><p>jakaśtreść1</p>
     </div>

     <div id="center"><p>jakaśtreść2</p>
     </div>

     <div id="right"><p>jakaśtreść3</p>
     </div>
</div>
Go to the top of the page
+Quote Post
woj_tas
post
Post #2





Grupa: Zarejestrowani
Postów: 230
Pomógł: 36
Dołączył: 31.03.2006
Skąd: Zielona Góra

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


Elementy floatowane "wyskakują" ze swojego rodzica. Dodaj do containera:
  1. overflow:hidden;


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





Grupa: Przyjaciele php.pl
Postów: 1 595
Pomógł: 282
Dołączył: 24.09.2007
Skąd: Reda, Pomorskie.

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


dodaj do html:
  1. <div id="container">
  2. <div id="left"><p>jakaśtreść1</p></div>
  3. <div id="center"><p>jakaśtreść2</p></div>
  4. <div id="right"><p>jakaśtreść3</p></div>
  5. <div style="clear:both"></div>
  6. </div>


--------------------

-
Oh no, my young coder. You will find that it is you who are mistaken, about a great many things... -
Go to the top of the page
+Quote Post
wujek_bogdan
post
Post #4





Grupa: Zarejestrowani
Postów: 76
Pomógł: 0
Dołączył: 8.03.2008

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


thx woj_tas

pomogło. temat do zamknięcia.
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: 19.08.2025 - 18:25