Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][CSS] Problem z divami
Turson
post
Post #1





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


HTML:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3c.org/1999/xhtml" xml:lang="pl" lang="pl">
  4. <meta http-equiv="content-type" content="text/html; charset=iso-8859-2" />
  5. <link rel="stylesheet" type="text/css" href="style_rek.css">
  6. </head>
  7. <title>strona glowna</title>
  8. <div class="logo"></div>
  9. <div class="linia" style="height:3px;"></div>
  10. <div class="menu"><div class="menu2">
  11. <ul>
  12. <li><a href="#">strona głowna</a></li>
  13. <li><a href="#">o nas</a></li>
  14. <li><a href="#">galeria</a></li>
  15. <li><a href="#">spotkania</a></li>
  16. <li><a href="#">kontakt</a></li>
  17. <li><a href="#">forum</a></li>
  18. </ul>
  19. </div></div>
  20. <div class="linia" style="height:8px;"></div>
  21. <div class="content">
  22. <div class="left">
  23. <div class="lefttext">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id q
  24. </div></div>
  25. <div style="right">text</div>
  26.  
  27.  
  28. </body>
  29. </html>

css
  1. body
  2. {
  3. font-family: Verdana, Arial, Helvetica, sans-serif;
  4. background:#efefef;
  5. vertical-align: top;
  6. margin:0px auto;
  7. padding:0;
  8. color:black;
  9. margin-bottom:5px;
  10. width:800px;
  11. margin-bottom:10px;
  12. border-left:1px solid #cfcfcf;
  13. border-right:1px solid #cfcfcf;
  14. border-bottom:1px solid #cfcfcf;
  15. }
  16. a {
  17. color:black;
  18. }
  19. .logo {
  20. background:url(logo.png) no-repeat top;
  21. width:799px;
  22. height:150px;
  23. }
  24. .menu {
  25. background:url(menu.png) no-repeat top;
  26. width:798px;
  27. height:50px;
  28. }
  29. .menu2{
  30. text-align:center;
  31. }
  32. ul, ul li {
  33. display: block;
  34. list-style: none;
  35. margin: 0;
  36. padding: 12px;
  37. }
  38.  
  39. ul li {
  40. color:white;
  41. text-decoration:none;
  42. display: inline;
  43. white-space: nowrap;
  44. letter-spacing:0px;
  45.  
  46. }
  47. li a {
  48. padding:7px 5px 7px 5px;
  49. font-size:17px;
  50. color:white;
  51. text-decoration:none;
  52. }
  53. li a:hover{
  54. letter-spacing:0px;
  55. padding:7px 5px 7px 5px;
  56. color:white;
  57. background:url(active.png)repeat-x;
  58. }
  59. .linia{
  60. background:#f4f4f4;
  61. width:100%;
  62. }
  63. .content {
  64. background-color:white;
  65. width:800px;
  66.  
  67. }
  68. .left{
  69. width:640px;
  70. float:left;
  71. }
  72. .right{
  73. width:160px;
  74. float:right;
  75. }
  76. .lefttext {
  77. padding-top:3px;
  78. margin-left:5px;
  79. margin-right:5px;
  80. padding-bottom:5px;
  81. font-size:15px;
  82. color:#161616;
  83. }
  84. .bgm2 {
  85. background:url(bgmenu2.png)repeat-y;
  86. width:140px;
  87. }
  88.  


Problem polega na tym, że (1) gdy do LEFT dodam float:left; nagle wszystko się sypie i tekst wystaje poza CONTENT oraz (2) div RIGHT nie dziala dobrze, bo tekst wyswietla sie pod LEFT a nie na rowni z nim...

Nie wiem co jest blinksmiley.gif sciana.gif
Go to the top of the page
+Quote Post
lobopol
post
Post #2





Grupa: Zarejestrowani
Postów: 1 729
Pomógł: 346
Dołączył: 4.04.2009

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


<div style="right">text</div> czemu tu jest style="right"?


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





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Pomylone z class, poprawiłem, teraz wyglada to tak: lewa kolumna-ok, ale prawa jest po prawej stronie pod lewą a nie na równi

Go to the top of the page
+Quote Post
lobopol
post
Post #4





Grupa: Zarejestrowani
Postów: 1 729
Pomógł: 346
Dołączył: 4.04.2009

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


prawej też daj float left, i content daj overflow:hidden

Ten post edytował lobopol 30.01.2011, 12:03:07


--------------------
Go to the top of the page
+Quote Post
Turson
post
Post #5





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Dałem float:left dla lewej i prawej, wyszło tak:

Czyli zbyt wcześnie skonczylo sie biale tlo i obramowanie
Go to the top of the page
+Quote Post
Damonsson
post
Post #6





Grupa: Zarejestrowani
Postów: 2 355
Pomógł: 533
Dołączył: 15.01.2010
Skąd: Bydgoszcz

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


Wypadałoby, przede wszystkim zamknąć diva "content" winksmiley.jpg

do content dodaj

height: 100%
overflow: hidden

Ten post edytował Damonsson 30.01.2011, 12:06:59
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 - 07:40