Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [css] Doposanie div do szerkosci
arzach
post
Post #1





Grupa: Zarejestrowani
Postów: 332
Pomógł: 6
Dołączył: 27.11.2008

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


Witam mam taki kod
  1. <style type="text/css">
  2. html, body {
  3.  
  4. margin: 0;
  5. padding: 0;
  6. }
  7.  
  8. #tresc {
  9. width: 1000px;
  10. height:768px;
  11. margin-left:auto;
  12. margin-right:auto;
  13. }
  14.  
  15. #tlo_lewa {
  16. background-image:url('images/01.gif');
  17. background-repeat:repeat-x;
  18. }
  19.  
  20. #tlo_prawa {
  21. background-image:url('images/02.gif');
  22. background-repeat:repeat-x;
  23. }
  24.  
  25.  
  26.  
  27. </head>
  28.  
  29. <div>
  30. <div id="tlo_lewa"></div>
  31. <div id="tresc">
  32. tutaj strona
  33. </div>
  34. <div id="tlo_prawa"></div>
  35. </div>




Div id #tresc ma stałą szerokość i chce by był wyśrodkowany do środka a otaczające go div# tlo_lewa i #tlo_prawa dopasowywały się automatycznie powtarzając obrazek
Obecny kod nie działa

Ten post edytował arzach 20.02.2012, 13:04:42
Go to the top of the page
+Quote Post
Harsay
post
Post #2





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 11.02.2011

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


Do tlo_lewa dodaj
Kod
float:right;

Do tlo_prawy dodaj
Kod
float: left;


Może pomoże.
Go to the top of the page
+Quote Post
cykcykacz
post
Post #3





Grupa: Zarejestrowani
Postów: 550
Pomógł: 9
Dołączył: 29.05.2009
Skąd: Ostrów Wielkopolski

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


Nie wiem czy oto ci chodzi ale spróbuj:
  1. #tlo_lewa {
  2. background-image:url('images/01.gif');
  3. background-repeat:repeat-x;
  4. float: left;
  5. }
  6.  
  7. #tresc {
  8. width: 1000px;
  9. height:768px;
  10. margin-left:auto;
  11. margin-right:auto;
  12. float: left;
  13. }
  14.  
  15.  
  16. #tlo_prawa {
  17. background-image:url('images/02.gif');
  18. background-repeat:repeat-x;
  19. float: left;
  20. }
Go to the top of the page
+Quote Post
arzach
post
Post #4





Grupa: Zarejestrowani
Postów: 332
Pomógł: 6
Dołączył: 27.11.2008

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


Nic to nie dało już wczesniej tak probowałem. @cykcykacz to co podałeś też nie działa

Ten post edytował arzach 20.02.2012, 13:10:29
Go to the top of the page
+Quote Post
cykcykacz
post
Post #5





Grupa: Zarejestrowani
Postów: 550
Pomógł: 9
Dołączył: 29.05.2009
Skąd: Ostrów Wielkopolski

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


  1. <style type="text/css">
  2. html, body {
  3.  
  4. margin: 0;
  5. padding: 0;
  6. }
  7.  
  8. #tresc {
  9. background-color: green;
  10. width: 1000px;
  11. height:768px;
  12. margin-left:auto;
  13. margin-right:auto;
  14. float: left;
  15. }
  16.  
  17. #tlo_lewa {
  18. background-image:url('images/01.gif');
  19. background-repeat:repeat-x;
  20. background-color: orange;
  21. width: 20px;
  22. height: 20px;
  23. float: left;
  24. }
  25.  
  26. #tlo_prawa {
  27. background-color: pink;
  28. background-image:url('images/02.gif');
  29. background-repeat:repeat-x;
  30. width: 20px;
  31. height: 20px;
  32. float: left;
  33. }
  34.  
  35. </style>


Trzeba nadać tlo_lewa oraz tlo_prawa długość i szerokość spróbuj tereaz (IMG:style_emoticons/default/smile.gif) .

Ten post edytował cykcykacz 20.02.2012, 13:14:48
Go to the top of the page
+Quote Post
arzach
post
Post #6





Grupa: Zarejestrowani
Postów: 332
Pomógł: 6
Dołączył: 27.11.2008

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


Nie działa także



Chce aby białe tło z lewej i prawej były pokryte obrazkiem który będzie się potarzał x razy i był dopasowane do środka

Ten post edytował arzach 20.02.2012, 13:37:14
Go to the top of the page
+Quote Post
crocodillo
post
Post #7





Grupa: Zarejestrowani
Postów: 215
Pomógł: 44
Dołączył: 31.07.2011
Skąd: wrocław

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


  1. <style type="text/css">
  2. html, body {
  3.  
  4. margin: 0;
  5. padding: 0;
  6. }
  7.  
  8. #tresc {
  9. width: 1000px;
  10. height:768px;
  11. margin-left:-500px;
  12. background-color:rgba(255,255,255,0.3);
  13. }
  14.  
  15. #tlo_lewa {
  16. background-color:rgba(255,0,0,0.5);
  17. }
  18.  
  19. #tlo_prawa {
  20. margin-left:50%;
  21. background-color:rgba(0,255,0,0.5);
  22. }
  23.  
  24.  
  25.  
  26. </head>
  27.  
  28. <div id="tlo_lewa">
  29. <div id="tlo_prawa">
  30. <div id="tresc">
  31. test
  32.  
  33. </div>
  34. </div>
  35. </div>
  36. </body>
Go to the top of the page
+Quote Post
kadlub
post
Post #8





Grupa: Zarejestrowani
Postów: 548
Pomógł: 105
Dołączył: 4.06.2010

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


Przykład

  1. <style type="text/css">
  2. html, body {
  3. margin:0;
  4. padding:0;
  5.  
  6. }
  7.  
  8. #tresc {
  9. width: 50%;
  10. height:768px;
  11. margin:auto;
  12. position:relative;
  13. background:#0000ff;
  14. }
  15.  
  16. #tlo_lewa {
  17. background:#ff0000;
  18. background-repeat:repeat-x;
  19. position:relative;
  20. height:768px;
  21. width: 25%;
  22. float:left;
  23. }
  24.  
  25. #tlo_prawa {
  26. background:#ffff00;
  27. background-repeat:repeat-x;
  28. position: realtive;
  29. height:768px;
  30. width: 25%;
  31. float:right;
  32. }
  33.  
  34.  
  35.  
  36. </head>
  37. <div>
  38. <div id="tlo_lewa">adsadsadsa</div>
  39. <div id="tlo_prawa">dsadsa</div>
  40. <div id="tresc">
  41. tutaj strona
  42. </div>
  43.  
  44. </div>
  45.  
  46.  



tylko poustawiaj sobie te swoje zdjęcia

Ten post edytował kadlub 20.02.2012, 13:41:21
Go to the top of the page
+Quote Post
arzach
post
Post #9





Grupa: Zarejestrowani
Postów: 332
Pomógł: 6
Dołączył: 27.11.2008

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


Cytat(kadlub @ 20.02.2012, 13:40:34 ) *
tylko poustawiaj sobie te swoje zdjęcia


Już prawie dobrze ale jak dam tak
  1. <style type="text/css">
  2. html, body {
  3. margin:0;
  4. padding:0;
  5.  
  6. }
  7.  
  8. #tresc {
  9. width: 50%;
  10. height:768px;
  11. margin:auto;
  12. position:relative;
  13. background:#0000ff;
  14. }
  15.  
  16. #tlo_lewa {
  17. background:#ff0000;
  18. background-repeat:repeat-x;
  19. position:relative;
  20. height:768px;
  21. width: 25%;
  22. float:left;
  23. background-image: url(images/01.gif);
  24. }
  25.  
  26. #tlo_prawa {
  27. background:#ffff00;
  28. background-repeat:repeat-x;
  29. position: realtive;
  30. height:768px;
  31. width: 25%;
  32. float:right;
  33. background-image: url(images/02.gif);
  34. }
  35.  
  36.  
  37.  
  38. </head>
  39. <div>
  40. <div id="tlo_lewa">adsadsadsa</div>
  41. <div id="tlo_prawa">dsadsa</div>
  42. <div id="tresc">
  43. <img src="images/tlo.gif" width="1000" height="768" alt="" />
  44. </div>
  45.  
  46. </div>
  47.  
  48.  
  49. </body>
  50. </html>


To ucieka do prawej ale jak zmienię
  1. #tresc {
  2. width: 50%;
  3. height:768px;
  4. margin:auto;
  5. position:relative;
  6. background:#0000ff;
  7. }


na
  1. #tresc {
  2. width: 1000px;
  3. height:768px;
  4. margin:auto;
  5. position:relative;
  6. background:#0000ff;
  7. }


To jest już dobrze ale nie mogę wtedy wstawić w ten div obrazek bo się nie wyświetla tylko niebieskie tło
A w ten div chce wstawić potem pocięte obrazki

Ten post edytował arzach 21.02.2012, 13:28:29
Go to the top of the page
+Quote Post
kadlub
post
Post #10





Grupa: Zarejestrowani
Postów: 548
Pomógł: 105
Dołączył: 4.06.2010

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



to zmień
background:#0000ff;
na
background-image: url(tu ścieżka do zdjęcia);
Go to the top of the page
+Quote Post
arzach
post
Post #11





Grupa: Zarejestrowani
Postów: 332
Pomógł: 6
Dołączył: 27.11.2008

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


Cytat(kadlub @ 20.02.2012, 14:31:52 ) *
to zmień
background:#0000ff;
na
background-image: url(tu ścieżka do zdjęcia);



Tam nie moze być background-image bo tam nie ma byc tła tylko w tym div #tresc bedą pocięte obrazki. I on ma mieć stałą szerkość czyli
  1. #tresc {
  2. width: 1000px;
  3. height:768px;
  4. margin:auto;
  5. position:relative;
  6. background:#0000ff;
  7. }


Dla tego chce tak wstawić
  1. <div>
  2. <div id="tlo_lewa">adsadsadsa</div>
  3. <div id="tlo_prawa">dsadsa</div>
  4. <div id="tresc">
  5. <img src="images/tlo.gif" width="1000" height="768" alt="" />
  6.  
  7. tutaj inne divy z pociętymi obrazkami
  8.  
  9.  
  10. </div>
  11.  
  12. </div>


I jak zrobię tak to jest prawie dobrze ale wyswietla sie niebiesko tło zamiast obrazka
  1. <title>Bez nazwy-12</title>
  2. <meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
  3.  
  4. <style type="text/css">
  5. html, body {
  6. margin:0;
  7. padding:0;
  8.  
  9. }
  10.  
  11. #tresc {
  12. width: 1000px;
  13. height:768px;
  14. margin:auto;
  15. position:relative;
  16. background:#0000ff;
  17. }
  18.  
  19. #tlo_lewa {
  20. background:#ff0000;
  21. background-repeat:repeat-x;
  22. position:relative;
  23. height:768px;
  24. width: 25%;
  25. float:left;
  26. background-image: url(images/01.gif);
  27. }
  28.  
  29. #tlo_prawa {
  30. background:#ffff00;
  31. background-repeat:repeat-x;
  32. position: realtive;
  33. height:768px;
  34. width: 25%;
  35. float:right;
  36. background-image: url(images/02.gif);
  37. }
  38.  
  39.  
  40.  
  41. </head>
  42. <div>
  43. <div id="tlo_lewa">adsadsadsa</div>
  44. <div id="tlo_prawa">dsadsa</div>
  45. <div id="tresc">
  46. <img src="images/tlo.gif" width="1000" height="768" alt="" />
  47.  
  48. tutaj inne divy z pociętymi obrazkami
  49.  
  50.  
  51. </div>
  52.  
  53. </div>
  54.  
  55.  
  56. </body>
  57. </html>


I jak teraz zrobić aby ten obrazek wyświetlał się zamiast niebieskiego tła (IMG:style_emoticons/default/questionmark.gif) ? On potem będzie pocięty na chwile obecną jest to jako jeden obrazek

Obecnie jest tak jak to poprawic (IMG:style_emoticons/default/questionmark.gif) (IMG:style_emoticons/default/questionmark.gif) ?



.

Czy ktoś jest w stanie mi pomóc.

Ten post edytował arzach 21.02.2012, 13:28:14
Go to the top of the page
+Quote Post

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: 16.09.2025 - 22:35