Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

2 Stron V   1 2 >  
Reply to this topicStart new topic
> [HTML][CSS] top strony problem w ie
Lejto
post 25.01.2010, 12:57:21
Post #1





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


Mam problem z css i obrazkami w topie strony.
FF

IE

Jak widać pod ie się rozwala.
Oto kod css i html, co tu jest nie tak? Myślę że winni tu między innymi input.
  1. <div id="img"></div>
  2. <div id="img2"></div>
  3. <span style="float:left;"><form action="szukaj" method="post"><input type="text" size="22" name="user" /><input value="" type="submit" id="img3" /></form></span>
  4. <div id="img4"></div>
  5. <div id="img5"></div>
  6. <div id="img6"></div>

i css
  1. #img{
  2. background-image : url('../images/bl_01.gif');
  3. background-repeat: no-repeat;
  4. width:900px;
  5. height:69px;
  6. float: left;
  7. }
  8. #img2{
  9. background-image : url('../images/bl_02.gif');
  10. width:16px;
  11. height:24px;
  12. float: left;
  13. }
  14. #img3{
  15. background-image : url('../images/bl_05.gif');
  16. width:53px;
  17. height:24px;
  18. float: right;
  19. }
  20. #img4{
  21. background-image : url('../images/bl_06.gif');
  22. width:465px;
  23. height:24px;
  24. float: left;
  25. margin-left:3px;
  26. }
  27. #img5{
  28. background-image : url('../images/bl_09.gif');
  29. width:30px;
  30. height:24px;
  31. float: left;
  32. }
  33. #img6{
  34. background-image : url('../images/bl_12.gif');
  35. width:900px;
  36. height:50px;
  37. float: left;
  38. }
  39.  


--------------------
Go to the top of the page
+Quote Post
pedro84
post 25.01.2010, 13:06:51
Post #2





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Chłopie, na co Ci tyle tych divów? Przecież to bez sensu. W ogóle to ten <span> problematycznie wygląda.


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Lejto
post 25.01.2010, 13:24:15
Post #3





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


no bo musiałem jakoś te obrazki umieścić dlatego musiałem tyle napisać? jak to inaczej zrobić
no span wygląda problematycznie, przez ten input no ale jak to poprawić?


--------------------
Go to the top of the page
+Quote Post
pedro84
post 25.01.2010, 13:46:06
Post #4





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Cytat(Lejto @ 25.01.2010, 13:24:15 ) *
no bo musiałem jakoś te obrazki umieścić dlatego musiałem tyle napisać? jak to inaczej zrobić
no span wygląda problematycznie, przez ten input no ale jak to poprawić?

Można było to zrobić o wiele lepiej, moim zdaniem.

Jak naprawić? Position:absolute i relative (dla elementu nadrzędnego).


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Lejto
post 25.01.2010, 14:01:39
Post #5





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


Cytat(pedro84 @ 25.01.2010, 13:46:06 ) *
Można było to zrobić o wiele lepiej, moim zdaniem.

Jak naprawić? Position:absolute i relative (dla elementu nadrzędnego).

ok, jak byś to zrobił?


--------------------
Go to the top of the page
+Quote Post
pedro84
post 25.01.2010, 14:29:42
Post #6





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


To jest element topu strony tak? Zarzuć jakimś większym screenem, a najlepiej to linkiem, to wtedy Ci mogę powiedzieć.


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Lejto
post 25.01.2010, 14:39:04
Post #7





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


http://lukasz-code.nspace.pl/blogi


--------------------
Go to the top of the page
+Quote Post
cook
post 25.01.2010, 14:45:56
Post #8





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 23.01.2010

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


Może stwórz osobny arkusz dla IE i tam rób tak żeby tylko wszystko wyglądało dobrze pod IE: http://leksykot.top.hell.pl/notatki/www/ie-hacks.shtml


--------------------
Style do MyBB za SMS
Go to the top of the page
+Quote Post
Lejto
post 25.01.2010, 15:05:43
Post #9





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


no z drugiej strony też racja


--------------------
Go to the top of the page
+Quote Post
pedro84
post 25.01.2010, 16:50:39
Post #10





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Wiesz...najpierw to popraw kod, bo w FF też Ci nie wyświetla poprawnie...

Moje propozycje:
Tworzysz div główny, #header
Kod
#header {
width:900px;
margin:0 auto;
height://tutaj wysokość obrazka
}


Nadajesz mu atrybut background:url(obrazek) top left; Jako obrazek podajesz, cały obrazek, bez cięcia. Zapisałbym go jako jpg z kolorem tła.

Nadajesz #header attrubyt position:relative;

Input, bez span, pozycjonujesz w nim relatywnie. To jest najlepsze rozwiązanie, masz jeden div i wszystko Ci będzie działać, bez hacków.



--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Lejto
post 25.01.2010, 17:02:29
Post #11





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


ok, ale jakie błędy widzisz pod ff?
u mnie wszystko ok widać chyba
zrób screena
czyli w <div id="header"> wrzucić resztę tak?


--------------------
Go to the top of the page
+Quote Post
pedro84
post 25.01.2010, 17:33:13
Post #12





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Cytat(Lejto @ 25.01.2010, 17:02:29 ) *
ok, ale jakie błędy widzisz pod ff?
u mnie wszystko ok widać chyba
zrób screena
czyli w <div id="header"> wrzucić resztę tak?

Tak, i tylko jeden obrazek, bez ensu tak ciąć i tworzyć n divów.

Jaki błąd? img4 przesunięty w prawo o 2px smile.gif


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Lejto
post 26.01.2010, 11:29:16
Post #13





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


ok, zobaczę jak to będzie
może nie dopatrzyłem tego
używasz najnowszego firefoxa?

posklejałem ten header w całość wrzuciłem w diva potem 2 div dla input postion absolute marginesy i gra ale tylko pod ff w ie spada na dół input


--------------------
Go to the top of the page
+Quote Post
pedro84
post 26.01.2010, 12:46:31
Post #14





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Cytat(Lejto @ 26.01.2010, 11:29:16 ) *
ok, zobaczę jak to będzie
może nie dopatrzyłem tego
używasz najnowszego firefoxa?

posklejałem ten header w całość wrzuciłem w diva potem 2 div dla input postion absolute marginesy i gra ale tylko pod ff w ie spada na dół input

Ja tam widzę dalej trzy, bez sensu trochę rozwiązanie smile.gif Firefox 3.5.7, pod dwójką nie sprwdzałem smile.gif


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Lejto
post 26.01.2010, 15:09:33
Post #15





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


bo nie aktualizowałem na serwerze ;p


--------------------
Go to the top of the page
+Quote Post
pedro84
post 26.01.2010, 15:11:05
Post #16





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Cytat(Lejto @ 26.01.2010, 11:29:16 ) *
posklejałem ten header w całość wrzuciłem w diva potem 2 div dla input postion absolute marginesy i gra ale tylko pod ff w ie spada na dół input

To jak chcesz pomocy to zaktualizuj smile.gif


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Lejto
post 27.01.2010, 10:23:36
Post #17





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 48
Dołączył: 23.05.2007

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


już zaktualizowane ; p


--------------------
Go to the top of the page
+Quote Post
pedro84
post 27.01.2010, 10:25:35
Post #18





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Cytat(Lejto @ 27.01.2010, 10:23:36 ) *
już zaktualizowane ; p

No i teraz git. W FF 3.5.7 jest wszystko ok.


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
bmL
post 27.01.2010, 12:02:33
Post #19





Grupa: Zarejestrowani
Postów: 301
Pomógł: 25
Dołączył: 15.07.2007
Skąd: Olsztyn

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


Zauważ że takich rzeczy jak loga nie wrzuca się jako tło divów z prostej przyczyny: dla tła diva nie ustawisz atrybutu alt. Takie zastosowanie eliminuje przeglądarki które nie obsługują obrazków, boty które indeksują twoją stronę itp. Nie wspominam już o osobach niepełnosprawnych.
Tak orientacyjnie:
  1. <div id="top">
  2. <div class="left">
  3. <form action="szukaj" method="post"><input type="text" size="22" name="user" /><input value="" type="submit" id="img3" /></form>
  4. </div>
  5. <div class="center">
  6. <img src="...logo.gif" alt="Blog-Video Blog.oferta.com">
  7. </div>
  8. <div class="right"></div>
  9. </div>

css
  1. div#top {
  2. margin:0 auto;
  3. width: 900px; // nie wiem ile tam powinno być
  4. height: 300px; // nie wiem ile powinno byc
  5. }
  6. div#top div {
  7. float: left; // zeby byly w poziomie
  8. height: inherit; // wysokość taka sama jak w divie top
  9. }
  10. dv#top div.left form {
  11. margin: 100px 0 0 100px;
  12. }
  13. div#top div.left {
  14. background: url('...');
  15. width: xxPX;
  16. }
  17. div#top div.cnt {
  18. background: url('...');
  19. width: xxPX;
  20. }
  21. div#top div.right {
  22. background: url('...');
  23. width: xxPX;
  24. }


No i taki kod powinien się sprawować tak samo we wszystkich przeglądarkach. Upewnij się też że masz ustawione na stronie odpowiedni doctype.


--------------------
Tutaj miał być jakiś mądry tekst. Miał być... No ale jest głupi tekst.
Go to the top of the page
+Quote Post
pedro84
post 27.01.2010, 12:09:12
Post #20





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


@bmL Nie mieszaj chłopakowi z tym kodem, przecież to masakra. Więcej divów nie mogłeś zrobić? Poza tym, tło ustawia się, ustawia. Jak najbardziej. Dajesz wtedyu <h1> w nim tytuł strony, slogan i nadajesz mu atrybut text-indent:-999em;. Ta metoda działa zdecydowanie lepiej niż alt dla <img>. Poczytaj trochę zanim kogoś wprowadzisz w błąd.

Ten post edytował pedro84 27.01.2010, 12:10:24


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post

2 Stron V   1 2 >
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 Wersja Lo-Fi Aktualny czas: 14.06.2025 - 19:52