Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default Linking Divs (+rep)

    At the moment my navigation is just a div for each link with the link's image as the background. I've also created rollovers so the background changes when the mouse rolls onto it.

    I now want to obviously put links in these divs so they actually work.

    I know that you need either text or an image in the div to be the link so I thought I'd be clever and make a transparrent .gif the size of the div. This works but it squashes the image up into the corner (on Firefox it becomes a thin grey box and on IE it just shows the red cross icon).

    Does anyone know how to sort this or is it possible to make the div itself a link?

    Thanks .

  2. #2
    Join Date
    Sep 2008
    Posts
    718
    Tokens
    0

    Default

    you didn't exactly make this clear, but im fairly sure that this would work:

    Code:
    <a href='url'><div id="id"></div></a>
    +.net - omg it's coming o_o

  3. #3
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    +rep to you once again my friend!!!

    Edit: Need to spread

  4. #4
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    Nooo don't do that, it's not valid as far as I can remember. (Would be habbdance.. :rolleyes

    Change the width and heigh elements of the a tag to what you want and add rollovers that way.


  5. #5
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    Nooo don't do that, it's not valid as far as I can remember. (Would be habbdance.. :rolleyes

    Change the width and heigh elements of the a tag to what you want and add rollovers that way.


  6. #6
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by L?KE View Post
    Nooo don't do that, it's not valid as far as I can remember. (Would be habbdance.. :rolleyes

    Change the width and heigh elements of the a tag to what you want and add rollovers that way.
    When you say "not valid", does that mean it won't work? Because it did, like a charm . Anyway I'll try and see if I can understand your idea and give it a go .

  7. #7
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    No I mean not valid as in..
    http://validator.w3.org/



  8. #8
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by L?KE View Post
    No I mean not valid as in..
    http://validator.w3.org/

    Oh, what happens if it's not then?

    And do you mean just have a rollover image rather than a rollover background?

  9. #9
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    No you can assign what you gave the div to the a, eg:

    Code:
    a {
    width: whatever px;
    height: whatever px;
    margin: 0;
    padding: 3px;
    text-align: center;
    /* ETC... */
    }
    And also validation is basically just rules you have to obide by when coding, even if it displays properly.


  10. #10
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by L?KE View Post
    No you can assign what you gave the div to the a, eg:

    Code:
    a {
    width: whatever px;
    height: whatever px;
    margin: 0;
    padding: 3px;
    text-align: center;
    /* ETC... */
    }
    And also validation is basically just rules you have to obide by when coding, even if it displays properly.
    Oh I have all that thanks .

    Do you mean have to as in legally or something?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •