[HELP] [HTML] background-color

Status
Not open for further replies.

iExplicit

Member
Jul 30, 2013
140
23
Hey Guys,

I am honestly very 'crap' at html i've started actually learning it 'properly' since Saturday i've picked up css along the way, but i keep getting this problem
When i hover over my tab it only highlights it, but i want the whole tab to turn that colour



But when i hover over it it keeps the tab the same colour but it just highlights the text in the dark red

a:hover {
text-decoration: underline;
color: #F3F781;
background-color: #610B0B;

}
 

Keydose

New Member
Sep 11, 2013
28
2
Unfortunately that's not how background-color works, background-color when used with texts only places a 'background' behind the text which makes it looks like it's been highlighted.
 

iExplicit

Member
Jul 30, 2013
140
23
Could you possibly take a screenshot of how the website looks so I can see what you're trying to achieve?
eb599d5c70f7037bd7ebb843a752d698.png

I want it so when i hover over the tab it'll change the WHOLE background colour like the home one so imagine my mouse is on home it turns like that [Im not explainin this well]
 

Keydose

New Member
Sep 11, 2013
28
2
eb599d5c70f7037bd7ebb843a752d698.png

I want it so when i hover over the tab it'll change the WHOLE background colour like the home one so imagine my mouse is on home it turns like that [Im not explainin this well]

Then surely you should be modifying the background-color of the tab's <div> tag or whatever it's contained in as opposed to the text.
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
I honestly don't understand what you mean, it looks as if you've done it in that screenshot.

Wrap your links in a div with an id of navigation and apply this to your CSS

Code:
div#navigation a {
    text-decoration: none;
    color: yellow;
    background-color: red;
}

    div#navigation a:hover {
        text-decoration: underline;
        color: #f3f781;
        background-color: #610b0b;
    }
 
  • Like
Reactions: NSA

iExplicit

Member
Jul 30, 2013
140
23
I honestly don't understand what you mean, it looks as if you've done it in that screenshot.

Wrap your links in a div with an id of navigation and apply this to your CSS

Code:
div#navigation a {
    text-decoration: none;
    color: yellow;
    background-color: red;
}

    div#navigation a:hover {
        text-decoration: underline;
        color: #f3f781;
        background-color: #610b0b;
    }

Didn't work the tab is gone, nevermind just close the thread please
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
I think I understand now, wrap your a's in div's

So your markup would be like this
HTML:
<div id="navigation">
    <div class="nav-tab"><a href="#">Home</a></div>
    <div class="nav-tab"><a href="#">About</a></div>
    <div class="nav-tab"><a href="#">Contact</a></div>
</div>

Then your CSS similar to this:
Code:
div#navigation div.nav-tab a {
    text-decoration: none;
    color: yellow;
    background-color: red;
}

    div#navigation div.nav-tab:hover a {
        text-decoration: underline;
        color: #f3f781;
        background-color: #610b0b;
    }

...I think, lol.
 

iExplicit

Member
Jul 30, 2013
140
23
I think I understand now, wrap your a's in div's

So your markup would be like this
HTML:
<div id="navigation">
    <div class="nav-tab"><a href="#">Home</a></div>
    <div class="nav-tab"><a href="#">About</a></div>
    <div class="nav-tab"><a href="#">Contact</a></div>
</div>

Then your CSS similar to this:
Code:
div#navigation div.nav-tab a {
    text-decoration: none;
    color: yellow;
    background-color: red;
}

    div#navigation div.nav-tab:hover a {
        text-decoration: underline;
        color: #f3f781;
        background-color: #610b0b;
    }

...I think, lol.
Thanks it works!
 
Status
Not open for further replies.

Users who are viewing this thread

Top