Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CSS] Hover
Furikae
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 18.01.2014

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


Hej. Jak przy takim CSS dodać hover (w obrazku)?

  1. .stronaglowna {
  2. position: absolute;
  3. margin: 51px 0 0 29px;
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
com
post
Post #2





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

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


może by tak więcej kodu kolego bo klasa strona gówna nikomu nic nie mówi my nie wózki (IMG:style_emoticons/default/wink.gif)

wrzuć na jsfiddle.net
Go to the top of the page
+Quote Post
Furikae
post
Post #3





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 18.01.2014

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


Dobra. Mam takiego Diva w HTML

  1. <div class="stronaglowna"><a href="index.html"><img src="images/projekt_03.gif" /></a></div>


A w CSS wygląda on tak:

  1. .stronaglowna {
  2. position: absolute;
  3. margin: 51px 0 0 29px;
  4. }


Chcę dodać hover z innym obrazkiem, żeby po najechaniu na element zmieniał się.
Go to the top of the page
+Quote Post
wujek2009
post
Post #4





Grupa: Zarejestrowani
Postów: 350
Pomógł: 31
Dołączył: 23.05.2010

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


Zmień to background i wówczas za pomocą CSSa zmienisz - lub podepnij kod pod jQuery i za pomocą hover() uzyskasz efekt.
Go to the top of the page
+Quote Post
tomxx
post
Post #5





Grupa: Zarejestrowani
Postów: 172
Pomógł: 27
Dołączył: 5.10.2013

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


  1. function pierwszy() {
  2. document.getElementById("obrazek").src="images/projekt_03.gif";
  3. }
  4. function drugi() {
  5. document.getElementById("obrazek").src="/*adres obrazka po najechaniu*/";
  6. }
Potem tylko dajesz dowolny id obrazkowi:
  1. <img id="obrazek" onmouseover="drugi()" onmouseout="pierwszy()" src="images/projekt_03.gif">


Ten post edytował tomxx 19.01.2014, 13:49:24
Go to the top of the page
+Quote Post
com
post
Post #6





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

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


http://stackoverflow.com/questions/1836192...-hover-with-css
Go to the top of the page
+Quote Post
Luna_s20
post
Post #7





Grupa: Zarejestrowani
Postów: 60
Pomógł: 8
Dołączył: 7.01.2014

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


  1. .klasa {
  2. cośtam
  3. }
  4.  
  5. .klasa:hover {
  6. cośtam
  7. }


lub

  1. .klasa {
  2. cośtam
  3. }
  4.  
  5. .klasa a:hover{
  6. cośtam
  7. }
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: 2.10.2025 - 22:52