Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][CSS]Wstawianie pseudoklasy hover do html'a
suhy
post 18.05.2009, 14:29:06
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 17.02.2008

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


witam. mam problem jak wkleic
Kod
a {
    background-image: url('adres/obrazek.png');
    background-repeat: no-repeat;
    width: 200px;
    height: 150px;
    display: block;
}
a:hover {
    background-image: url('adres/obrazek_hover.png');
    background-repeat: no-repeat;
    width: 200px;
    height: 150px;
}


do htmla zeby dzialalo
Go to the top of the page
+Quote Post
Wicepsik
post 18.05.2009, 14:30:13
Post #2





Grupa: Zarejestrowani
Postów: 1 575
Pomógł: 299
Dołączył: 26.03.2009

Ostrzeżenie: (20%)
X----


  1. <style type="text/css"><!--
  2. a {
  3. background-image: url('adres/obrazek.png');
  4. background-repeat: no-repeat;
  5. width: 200px;
  6. height: 150px;
  7. display: block;
  8. }
  9. a:hover {
  10. background-image: url('adres/obrazek_hover.png');
  11. background-repeat: no-repeat;
  12. width: 200px;
  13. height: 150px;
  14. }
  15. --></style>


--------------------
Go to the top of the page
+Quote Post
suhy
post 18.05.2009, 14:33:47
Post #3





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 17.02.2008

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


niestety ale niedziala, moze podesle caly html

Ten post edytował suhy 18.05.2009, 14:35:50
Go to the top of the page
+Quote Post
Procesor
post 18.05.2009, 14:38:20
Post #4





Grupa: Zarejestrowani
Postów: 23
Pomógł: 2
Dołączył: 17.12.2008

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


W head wklejasz ten kod, co kolega podał dwa posty wyżej, pomijając <!-- oraz -->.
Go to the top of the page
+Quote Post
slawny
post 18.05.2009, 14:39:26
Post #5





Grupa: Zarejestrowani
Postów: 214
Pomógł: 26
Dołączył: 7.11.2007
Skąd: Warszawa

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


To albo nie działa css, który napisałeś albo kod html.
Bo tak właśnie zagnieżdża się css w html.
Go to the top of the page
+Quote Post
suhy
post 18.05.2009, 14:43:35
Post #6





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 17.02.2008

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


czyli do head wstawiam
Kod
<style type="text/css"></style>
a tam gdzie chce obrazek
Kod
<!--
a {
    background-image: url('adres/obrazek.png');
    background-repeat: no-repeat;
    width: 200px;
    height: 150px;
    display: block;
}
a:hover {
    background-image: url('adres/obrazek_hover.png');
    background-repeat: no-repeat;
    width: 200px;
    height: 150px;
}
-->



czy jak...
Go to the top of the page
+Quote Post
Crozin
post 18.05.2009, 14:56:44
Post #7





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

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


1) Przeczytaj o regule DRY
2) Tworzysz nowy plik o nazwie np. style.css i zawartości takiej jak w pierwszym poście
3) W kodzie HTML dajesz w elemencie HEAD kod:
  1. <link rel="stylesheet" href="./style.css" type="text/css" />
Go to the top of the page
+Quote Post
suhy
post 18.05.2009, 15:02:58
Post #8





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 17.02.2008

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


a jest moze inny sposob latwiejszy.. bo mi to chodzi na allegro bo se mam szablon gotowy i tam sa przyciski takie wlasnie animowane. onmouse nie dziala a te hover i css to dla mnie troche za duzo
http://allegro.pl/item633869136_szablony_s...dywidualny.html --> przyklad animowanych przyciskow
http://www.suh.cba.pl/00/qpage.htm --> moj szablon [tu jest na onmouse]
Go to the top of the page
+Quote Post
Crozin
post 18.05.2009, 15:20:44
Post #9





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

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


No to w takim razie poprostu w HEAD wstawiasz:
Kod
<style type="text/css">
  //kod z pierwszego postu
</style>
I tyle.
Go to the top of the page
+Quote Post
suhy
post 18.05.2009, 15:33:00
Post #10





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 17.02.2008

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


crozin moglbys mi to zrobic.. podeslal bym ci html caly i bys mi to zrobil
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 Wersja Lo-Fi Aktualny czas: 18.07.2025 - 11:49