Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Ograniczony clear
bigZbig
post
Post #1





Grupa: Zarejestrowani
Postów: 740
Pomógł: 15
Dołączył: 23.08.2004
Skąd: Poznań

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


Mam typowy trzykolumnowy uklad strony oparty na plywaniu (float). Ponizej zamiescilem uproszczony kod strony i arkusza styli.

W srodkowej czesci mam obrazek. Chce aby ten obrazek byl oplywany przez nastepujacy po nim tekst. Natomiast pod tekstem mam kolejny element "podsumowanie" (class="summary"). Podsumowanie ma sie zawsze znajdowac pod obrazkiem. Moge uzyc clear: left ale wtedy trace opływanie wzgledem lewej kolumny. Moge ustalić wysokość dla tekstu poprzedzajacego podsumowanie, ale w przypadku przepełnienia tekst ten zleje się z trescia podsumowania.

Czy jest jakas mozliwosc zrobienia wzglednego clear, albo jakis inny trik, ktory rozwiazalby moj problem?

Kod
/* <![CDATA[ */

#header {
  background: yellow;
}
.wrapper {
  clear: both;
}
.wrapper:after {
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

#columnLeft {
  float: left;
  width: 200px;
  background: blue;
}

#columnMiddle {
  display: block;
  margin-left: 200px;
  margin-right: 200px;
}

#columnRight {
  float: right;
  width: 200px;
  background: blue;
}

#columnLeftBottom {
  float: left;
  width: 50%;
}

#columnRightBottom {
  width: 49%;
  margin-left: 50%;
}

#footer {
  clear: both;
  background: yellow;
}

.content {
  padding: 1em;
  position: relative;
  z-index: 3;
}

.content img {
  float: left;
  height: 150px;
  width: 150px;
  margin-right: 20px;
  margin-bottom: 20px;
  background: red;
}

.content .summary {
  clear: left;
  background: green;
}
/* ]]> */


  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" >
  3. <meta name="author" content="" />
  4. <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
  5. <title>Example</title>
  6.  
  7. <link rel="stylesheet" href="style.css" type="text/css" />
  8.  
  9. </head>
  10. <div id="page">
  11. <div id="header">
  12. <div class="content">
  13. <h1>Header</h1>
  14. </div>
  15. </div>
  16. <div id="wrapperTop" class="wrapper">
  17. <div id="columnLeft">
  18. <div class="content">
  19. <h1>Left</h1>
  20. <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  21. </div>
  22. </div>
  23. <div id="columnRight">
  24. <div class="content">
  25. <h1>Right</h1>
  26. <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  27. </div>
  28. </div>
  29. <div id="columnMiddle">
  30. <div class="content">
  31. <h1>Middle</h1>
  32. <img src="picture.gif" />
  33. <p class="text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
  34. <p class="summary">Lorem Ipsum is simply dummy text</p>
  35. </div>
  36. </div>
  37. </div>
  38. <div id="footer">
  39. <div class="content">
  40. <h1>Footer</h1>
  41. </div>
  42. </div>
  43. </div>
  44. </body>
  45. </html>
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: 27.09.2025 - 16:34