Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2012
    Location
    Under your bed.
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Is there a way to change the default rectangular view for a:hover background images?

    For instance,

    Code:
     a:hover {
      color: black;
      background:url("images/nav-hm.png");
        }
    The background image displayed upon hover is always enclosed in a rectangular box around the link even though the image isn't rectangular .

    Is there a way to remove the rectangular box enclosure ?

    Thanks in Advance ~

  • #2
    New Coder
    Join Date
    Apr 2012
    Posts
    14
    Thanks
    0
    Thanked 1 Time in 1 Post
    Try adding border: 0;

  • #3
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    946
    Thanks
    0
    Thanked 129 Times in 128 Posts
    @jrote1; adding a border changes nothing.

    to make the link high enough to display the entire image, you can do:
    Code:
    a{display:inline-block;
    height:XXpx;
    }
    where XXpx is the height of the background-image.

  • #4
    New Coder
    Join Date
    Apr 2012
    Location
    Under your bed.
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Lerura View Post
    @jrote1; adding a border changes nothing.

    to make the link high enough to display the entire image, you can do:
    Code:
    a{display:inline-block;
    height:XXpx;
    }
    where XXpx is the height of the background-image.
    I tried setting the exact height and width of the background image, but it still turned out as a rectangular image =/ .

  • #5
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    946
    Thanks
    0
    Thanked 129 Times in 128 Posts
    do you have a link to your page,
    or can you post your entire code and attach relevant images.


  •  

    Posting Permissions

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