28. marts 2003 - 17:28
Der er
26 kommentarer og 1 løsning
CSS Rollover?
Jeg har nogle <td>` som skal have et rollover så bg skifter farve hvordan gør jeg det i CSS?
Annonceindlæg tema
Cloud & AI
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
28. marts 2003 - 17:35
#1
<td onMouseover="this.style.backgroundColor='#ff0000';" onMouseout="this.style.backgroundColor='#ffffff';"> vi er røde - vi er hvide...</td>
28. marts 2003 - 17:36
#2
<html> <head> <style type="text/css"> a:link, a:active, a:visited {display: block; width: 200px; background-color: red} a:hover {display: block; width: 200px; background-color: blue} </style> </head> <body> <table border="1"><tr> <td><a href="fil.html">Tekst</a></td> </tr></table> </body> </html>
28. marts 2003 - 17:38
#3
Hvad så hvis det skal sættes ind her?: style.css: .menu { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #FFE697; border-right-width: 1px; border-bottom-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000;
28. marts 2003 - 17:40
#4
du kan lave en klasse .tdHover { background-color: red; } .tdHoverOut { background-color: white; } og så i din htmlkode skrive <td onMouseover="this.style.className='tdHover'" onMouseout="this.style.className='tdHoverOut'"> vi er røde - vi er hvide </td>
28. marts 2003 - 17:42
#5
ups -rettelse - du skal ikke have "style" med <td onMouseover="this.className='tdHover'" onMouseout="this.className='tdHoverOut'"> vi er røde - vi er hvide </td>
28. marts 2003 - 17:43
#6
Du kan gøre således: <html> <head> <style type="text/css"> .menu a:link, .menu a:active, .menu a:visited {display: block; width: 200px; background-color: red} .menu a:hover { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #FFE697; border-right-width: 1px; border-bottom-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; } </style> </head> <body> <table border="1"><tr> <td class="menu"><a href="fil.html">Tekst</a></td> </tr></table> </body> </html>
28. marts 2003 - 17:52
#7
don >> kunne du bruge det ???
28. marts 2003 - 17:54
#8
Det vil ikke virke:( Schaefner er der ikke en fejl? Prøv at sæt det ind i .menu her: Style.css-> .style1 { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; border-right-width: 1px; border-right-style: solid; } .bgtop { background-image: url(mauls.png); background-position: right center; background-attachment: fixed; background-repeat: no-repeat; } .menubg { background-image: url(menubg.png); } .menu { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #FFE697; border-right-width: 1px; border-bottom-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; } .menutop { background-color: #FFE697; border-top-width: 1px; border-right-width: 1px; border-top-style: solid; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-width: 1px; } .bottom { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #CCCCCC; border-top-width: 1px; border-top-style: solid; border-top-color: #000000; } .cornor { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: none #000000; border-left: none #000000; background-color: #535352; } .tdHover { background-color: #FFE697; } .tdHoverOut { background-color: #535352; }
28. marts 2003 - 17:55
#9
Hvilken vil ikke virke - min eller schaefner's ?
28. marts 2003 - 17:57
#10
Schaefners er best hvis den alså vil virke:O)
28. marts 2003 - 18:00
#11
har du prøve at sætte mit sidste eksempel ind i din css-fil?
28. marts 2003 - 18:01
#12
Jeps...
28. marts 2003 - 18:07
#13
Den virker fint her.
28. marts 2003 - 18:08
#14
Så post det dog!O) Pleaz...
28. marts 2003 - 18:09
#15
det har jeg gjort
28. marts 2003 - 18:10
#16
Da ikke hele koden hvor du har sat det ind?
28. marts 2003 - 18:19
#17
Schafner vil du ikke godt poste den? Det er det sidste jeg mangler...
28. marts 2003 - 18:29
#18
<html> <head> <style type="text/css"> .menu a:link, .menu a:active, .menu a:visited {display: block; width: 200px; background-color: red} .menu a:hover { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #FFE697; border-right-width: 1px; border-bottom-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; } </style> </head> <body> <table border="1"><tr> <td class="menu"><a href="fil.html">Tekst</a></td> </tr></table> </body> </html> Er det ikke det?
28. marts 2003 - 18:31
#19
Jo.. Men kan du ikke sætte det ind i det her: .style1 { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; border-right-width: 1px; border-right-style: solid; } .bgtop { background-image: url(mauls.png); background-position: right center; background-attachment: fixed; background-repeat: no-repeat; } .menubg { background-image: url(menubg.png); } .menu { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #FFE697; border-right-width: 1px; border-bottom-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; } .menutop { background-color: #FFE697; border-top-width: 1px; border-right-width: 1px; border-top-style: solid; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-width: 1px; } .bottom { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #CCCCCC; border-top-width: 1px; border-top-style: solid; border-top-color: #000000; } .cornor { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: none #000000; border-left: none #000000; background-color: #535352; }
28. marts 2003 - 18:32
#20
Jeg syntes nemlig ikke det virker når jeg gør det...
28. marts 2003 - 18:37
#21
og det jeg har postet er style.css...
28. marts 2003 - 18:44
#22
Hjææææææææælpe schaefner!
28. marts 2003 - 18:58
#23
Det er vel bare: <html> <head> <style type="text/css"> .style1 { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; border-right-width: 1px; border-right-style: solid; } .bgtop { background-image: url(mauls.png); background-position: right center; background-attachment: fixed; background-repeat: no-repeat; } .menubg { background-image: url(menubg.png); } .menutop { background-color: #FFE697; border-top-width: 1px; border-right-width: 1px; border-top-style: solid; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-width: 1px; } .bottom { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #CCCCCC; border-top-width: 1px; border-top-style: solid; border-top-color: #000000; } .cornor { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: none #000000; border-left: none #000000; background-color: #535352; } .menu a:link, .menu a:active, .menu a:visited { display: block; width: 200px; background-color: red } .menu a:hover { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 10px; background-color: #FFE697; border-right-width: 1px; border-bottom-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; } </style> </head> <body> <table border="1"><tr> <td class="menu"><a href="fil.html">Tekst</a></td> </tr></table> </body> </html>
28. marts 2003 - 19:44
#24
Hvordan sætter jeg hight på rollover?
28. marts 2003 - 19:47
#25
height: 40px;
28. marts 2003 - 19:55
#26
Lige et sidste, no underline?
28. marts 2003 - 20:15
#27
Nå... Jeg fandt ud af det selv:O) text-decoration:none;
Vi tilbyder markedets bedste kurser inden for webudvikling