Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][CSS]Div jako hiperłącze, bez tekstu
banite
post 9.04.2009, 18:00:27
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 4.04.2009

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


Witam, chodzi mi o to żeby w wierszu
<a href="index.html">link</a>
nie musiał wpisywać tego "Link". Jak go nie wpisuje to wtedy nie mam hiperłącza, a potrzebuje żeby w tym miejscu nie było żadnego tekstu :/

Ten post edytował banite 9.04.2009, 18:02:15


--------------------
Does avatar mean it? Obviously, I wanted to.
Go to the top of the page
+Quote Post
hondek
post 9.04.2009, 18:06:24
Post #2





Grupa: Zarejestrowani
Postów: 355
Pomógł: 50
Dołączył: 20.08.2007
Skąd: Częstochowa

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


To co w takim razie ma byc hiperlaczem?

  1. <a class="div" href="index.html">link</a>


a w css
  1. .div { display: block; width: x; height: y; }


Ten post edytował hondek 9.04.2009, 18:08:46


--------------------
przetwornik yt na czasie :)
Go to the top of the page
+Quote Post
banite
post 9.04.2009, 18:09:55
Post #3





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 4.04.2009

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


chcę zrobić menu złożone wyłącznie z gifów


--------------------
Does avatar mean it? Obviously, I wanted to.
Go to the top of the page
+Quote Post
hondek
post 9.04.2009, 18:16:09
Post #4





Grupa: Zarejestrowani
Postów: 355
Pomógł: 50
Dołączył: 20.08.2007
Skąd: Częstochowa

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


więc zrób tak jak napisalem, w css daj display: block, bedzie wtedy znacznik a traktowany jak div smile.gif bedziesz mogl mu nadac szerokosc i wysokosc i rowniez podac background-image winksmiley.jpg
ew. mozesz zrobic:
  1. <a href="link"><imr src="jakis.gif" alt="" /></a>


--------------------
przetwornik yt na czasie :)
Go to the top of the page
+Quote Post
banite
post 9.04.2009, 18:21:44
Post #5





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 4.04.2009

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


w tym cały problem że nie mogę, bo wtedy ten img jest traktowany jako główny i nie chce się na nic zmienić :/

no widzisz.
<a class="div" href="index.html">link</a>
i ja nie chcę żeby był ten "link".
Zrobiłem tak jak napisałeś, niestety nadal nie działa.

Ten post edytował banite 9.04.2009, 18:17:51


--------------------
Does avatar mean it? Obviously, I wanted to.
Go to the top of the page
+Quote Post
hondek
post 9.04.2009, 18:26:25
Post #6





Grupa: Zarejestrowani
Postów: 355
Pomógł: 50
Dołączył: 20.08.2007
Skąd: Częstochowa

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


Musisz ustawic szerokosc i wysokosc.
  1. <a href="dupa" style="display:block; width: 100px; height: 100px; background-image: url(menu_01.png);"></a>


Ten post edytował hondek 9.04.2009, 18:27:08


--------------------
przetwornik yt na czasie :)
Go to the top of the page
+Quote Post
banite
post 9.04.2009, 18:36:32
Post #7





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 4.04.2009

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


ale jak najadę myszką wtedy na tego buttona to się nie zmienia gif;/

cześć zmienna css
.menu1 a:link,a:visited,a:hover,a:active{
text-decoration:none;
display:inline;
float:left;
line-height:50px;
width:82px;
color:green;
text-align:center;
background: url("button1.gif") no-repeat right top;}

.menu1 a:hover{
color:orange;
background: url("button2.gif") no-repeat right top;}

a:active{
color:black;
background: url("button3.gif") no-repeat right top;}


xhtml

<div class="menu">
<div id="menu1">
<a href="twor.html" style="display:block; width: 82px; height: 50px; background-image: url(button1.gif);"></a>
</div>
</div>

Ten post edytował banite 9.04.2009, 18:42:40


--------------------
Does avatar mean it? Obviously, I wanted to.
Go to the top of the page
+Quote Post
Spawnm
post 9.04.2009, 18:40:56
Post #8





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




no to albo daj w css :hover
albo w js rollower czyli
onMouseOver , onMouseOut
Go to the top of the page
+Quote Post
banite
post 9.04.2009, 18:45:18
Post #9





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 4.04.2009

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


przecież dałem hover i dalej nic.
Czy to jest możliwe do zrobienia? najlepiej by było zrobić hiperłącze z diva ale nie umiem


--------------------
Does avatar mean it? Obviously, I wanted to.
Go to the top of the page
+Quote Post
hondek
post 9.04.2009, 19:00:02
Post #10





Grupa: Zarejestrowani
Postów: 355
Pomógł: 50
Dołączył: 20.08.2007
Skąd: Częstochowa

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


a dlaczego dajesz najpierw .menu1 a:link,a:visited,a:hover,a:active
a potem .a:hover {
nie wiem jak to interpretuje przegladarka ale moze w tym jest problem?
i po co w html'u ustawiasz style, skoro juz ustawione masz w cssie, powywalaj to smile.gif

Ten post edytował hondek 9.04.2009, 19:05:37


--------------------
przetwornik yt na czasie :)
Go to the top of the page
+Quote Post
banite
post 9.04.2009, 19:16:06
Post #11





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 4.04.2009

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


zaraz zwariuje dosłownie, nic mi nie wychodzi biggrin.gif


--------------------
Does avatar mean it? Obviously, I wanted to.
Go to the top of the page
+Quote Post
hondek
post 9.04.2009, 19:31:19
Post #12





Grupa: Zarejestrowani
Postów: 355
Pomógł: 50
Dołączył: 20.08.2007
Skąd: Częstochowa

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


daj tak
index.html:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <link rel="stylesheet" type="text/css" href="style.css" />
  4. </head>
  5.  
  6. <a href="dupa" class="a"></a>
  7. </body>
  8. </html>

plik style.css :
  1. .a {
  2. display:block; width: 100px; height: 100px; background-image: url(menu1.gif);
  3. }
  4. .a:hover {
  5. background-image: url(menu2.gif);
  6. }


Ten post edytował hondek 9.04.2009, 19:31:47


--------------------
przetwornik yt na czasie :)
Go to the top of the page
+Quote Post
banite
post 9.04.2009, 19:49:34
Post #13





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 4.04.2009

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


dzięki wszystkim za pomoc, udało się.
pomógł dla hondek


--------------------
Does avatar mean it? Obviously, I wanted to.
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: 24.04.2025 - 04:30