Avatar billede donwang Nybegynder
28. marts 2003 - 23:45 Der er 5 kommentarer og
1 løsning

CSS problem?

Jeg har et problem, når man har trykket på et af linksne i menuen på http://www.simplesolutions.dk/mauls/ går min CSS rollover helt i spasser. Er der nogen der kan hjælpe mig med at få den til at virke optimalt?

Style.css:

.menu a:link, .menu a:active, .menu a:visited {
    display: block;
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    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;
    width: 120px;
    hight: 20px;
    background-color: #FFE697;
    color: #000000;
    text-decoration:none;
    height: 20px;
}
.menu a:hover {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    background-color: #535352;
    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;
    text-decoration:none;   
    border-left-color: #000000;
    height: 20px;
}
.menutop a:link, .menu a:active, .menu a:visited {
    display: block;
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-top-width: 1px;
border-top-style: soild;
    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;
    width: 120px;
    hight: 20px;
    background-color: #FFE697;
    color: #000000;
    text-decoration:none;
    height: 20px;
}
.menutop a:hover {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    background-color: #535352;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-top-width: 1px;
border-top-style: soild;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: none;
    border-top-color: #000000;
    border-right-color: #000000;
    border-bottom-color: #000000;
    text-decoration:none;
    border-left-color: #000000;
    height: 20px;
}
Avatar billede raffar Juniormester
29. marts 2003 - 00:34 #1
Avatar billede knudgert Nybegynder
29. marts 2003 - 00:43 #2
Selvom det er lidt større arbejde, så split din css op, det er ret vigtigt, at det står i rigtig rækkefølge.
link, visited, hover, active.

Du mangler også en width på hoverelementet og iflg. ovenstående er der er en stavefejl et par steder, hvor du skriver hight og ikke height.

Det er iøvrigt kun IE, der fejler i Mozilla er der ingen problemer.
Avatar billede donwang Nybegynder
29. marts 2003 - 10:18 #3
Jeg er kørt surt idet:(... Er der ikke en der vil hjælpe med rette fejlene?
Også sådan at rollover virker når man har besøgt linksne?

.style1 {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    border-right-width: 1px;
    border-right-style: solid;
    border-bottom-width: 1px;
    border-bottom-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);
}
.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: none #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;
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    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-right-color: #000000;
    border-bottom-color: #000000;
    border-left-color: #000000;
    width: 120px;
    height: 20px;
    background-color: #FFE697;
    color: #000000;
    text-decoration:none;
    height: 20px;
}
.menu a:hover {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    background-color: #535352;
    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-right-color: #000000;
    border-bottom-color: #000000;
    text-decoration: none;   
    border-left-color: #000000;
    height: 20px;
}
.menutop a:link, .menu a:active, .menu a:visited {
    display: block;
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-top-width: 1px;
    border-top-style: solid;
    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;
    width: 120px;
    height: 20px;
    background-color: #FFE697;
    color: #000000;
    text-decoration:none;
    height: 20px;
}
.menutop a:hover {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 10px;
    background-color: #535352;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-top-width: 1px;
    border-top-style: soild;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: none;
    border-top-color: #000000;
    border-right-color: #000000;
    border-bottom-color: #000000;
    text-decoration:none;
    border-left-color: #000000;
    height: 20px;
}
.top {
    border-bottom-width: 1px;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: solid;
    border-left-style: none;
    border-bottom-color: #000000;
}
Avatar billede donwang Nybegynder
29. marts 2003 - 17:07 #4
Ingen der vil hjælpe?
Avatar billede olebole Juniormester
29. marts 2003 - 17:22 #5
<ole>

For det første roder du vist lidt i denne linie:
  .menutop a:link, .menu a:active, .menu a:visited {
Mener du mon ikke '.menutop' i hele linien?
Derudover bør du angive fuld sti til dine baggrundsbilleder og skrive dine font-familier med småt.
Endvidere bør du - af hensyn til overskuelighed og filstørrelse - slanke dine border-angivelser. Du kan f.eks. skrive:
  border: 1px solid #ff0000;
Så gælder det for alle borders i den celle.

/mvh
</bole>
Avatar billede olebole Juniormester
29. marts 2003 - 17:34 #6
Prøv, om ikke dette kan bruges (sæt selv absolutte stier til baggrundsbillederne):

.style1 {
    font-family: geneva, arial, helvetica, sans-serif;
    font-size: 10px;
    border-right: 1px solid;
    border-bottom: 1px solid;
}
.bgtop {
    background : url(mauls.png) no-repeat fixed center;
}
.menubg {
    background-image: url(menubg.png);
}
.bottom {
    font-family: geneva, arial, helvetica, sans-serif;
    font-size: 10px;
    background-color: #CCCCCC;
    border-top: 1px solid #000000;
}
.cornor {
    border-right: 1px solid #000000;
    background-color: #535352;
}
.menu a:link, .menu a:active, .menu a:visited {
    display: block;
    font-family: geneva, arial, helvetica, sans-serif;
    font-size: 10px;
    border-right: 1px solid #000000;
    border-bottom-width: 1px solid #000000;
    width: 120px;
    height: 20px;
    background-color: #FFE697;
    color: #000000;
    text-decoration:none;
}
.menu a:hover {
    background-color: #535352;
    text-decoration: none;   
}
.menutop a:link, .menutop a:active, .menutop a:visited {
    display: block;
    font-family: geneva, arial, helvetica, sans-serif;
    font-size: 10px;
    border: 1px solid #000000;
    border-left-style: none;
    width: 120px;
    height: 20px;
    background-color: #FFE697;
    color: #000000;
    text-decoration:none;
}
.menutop a:hover {
    background-color: #535352;
    text-decoration:none;
    border-left-color: #000000;
}
.top {
    border-bottom: 1px solid #000000;
}
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester