CSS help

Discussion in 'HTML & Website Design' started by sam20e, Jul 19, 2012.

  1. #1
    Hi i have a Joomla template. my banner CSS :

    #header {
        width: 1000px;
        margin: auto;
        margin-top: 26px;
        height: 157px;
        margin-bottom: -1px; /* iPhone/iPad fix */
        overflow: auto;
        background-image:url(../images/header-bg.png);
        background-repeat:no-repeat;   
        background-color: #CF171F;
    Code (markup):
    can anyone brief me how can i add a hover image? when i move my mouse over this banner header-bg.png it should change to header-bg2.png

    any help?

    Sam
     
    Solved! View solution.
    sam20e, Jul 19, 2012 IP
  2. #2
    Ok, pure css.. I got it working with this code

    
    <div id="header"></div>
    
    HTML:
    
    #header{
        display: block;
        width: 250px;
        height: 250px;
        background: transparent url('../images/header-bg.png') center top no-repeat;
    
    }
    #header:hover {
        background-image: url('../images/header-bg2.png');
    }
    
    Code (markup):
    adapt the code as needed.
     
    GMF, Jul 19, 2012 IP
  3. sam20e

    sam20e Member

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #3
    worked. thanks alot :)
     
    sam20e, Jul 19, 2012 IP
  4. ColourKraft

    ColourKraft Member

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    38
    #4
    If you're using pseudo classes make sure you put them in the correct order in your CSS file :)link :visited :hover :focus :active) if you put them in the incorrect order they won't function in certain browsers.
     
    ColourKraft, Jul 19, 2012 IP
  5. annahussy

    annahussy Greenhorn

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #5
    Thanks , GMF. That will be great information that you suggest over here. I am saying that I tried to go for your CSS styles. It really works to your whole detail. If I go for certain more CSS styles then Do you think so that It will work?
     
    annahussy, Jul 20, 2012 IP