Results 1 to 4 of 4

Thread: CSS code alignment "problems", image moves

  1. #1
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS code alignment "problems", image moves

    I have been using the following script in a stylesheet:

    HTML Code:
    <style type="text/css">
    
    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */
    
    .toggleopacity img{
    filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
    -moz-opacity: 0.5;
    }
    
    .toggleopacity:hover img{
    filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
    -moz-opacity: 1;
    }
    
    .toggleopacity img{
    border: 1px solid #ccc;
    }
    
    .toggleborder:hover img{
    border: 1px solid navy;
    }
    
    .toggleborder:hover{
    color: red; /* Dummy definition to overcome IE bug */
    }
    
    </style>
    This code was put in the html+a link to the stylesheet:
    HTML Code:
    <a class="toggleborder" href="http://www.dynamicdrive.com/style/">
    <img border="0" src="media/button2.gif" width="163" height="57" />
    </a>
    The only problem is:http://www.mhwloeffenedu.cursistennet.nl/home.htm (css works perfectly)except the image moves a little bit. Obviously I don't want this to happen. Is there a way I can prevent this problem from occuring?

    Thx in advance!

    ps sorry for the smilies, i saw later that they also could be disabled!
    Last edited by Snookerman; 05-08-2009 at 06:46 PM. Reason: added [html] tags

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Remove the highlighted:
    Code:
    <img border="0" src="media/button2.gif" width="163" height="57" />
    Good luck!

  3. #3
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Snookerman View Post
    Remove the highlighted:
    Code:
    <img border="0" src="media/button2.gif" width="163" height="57" />
    Good luck!
    http://www.mhwloeffenedu.cursistennet.nl/home.htm

    I have done as you said but unfortunatelly it still moves!

    Now I have this code:

    HTML Code:
            <a class="toggleborder" href="contact/contact.htm">
    	<img src="pictures/logo_wb.gif"/>

    Maybe you can help me out here?
    Last edited by Snookerman; 05-08-2009 at 06:47 PM. Reason: added [html] tags

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Well I'm not sure what border you want the image to have when you don't hover over it, but if you want tog get rid of the jumping you have to specify something, e.g.:
    Code:
    .toggleborder img{
    border: 1px solid #fff;
    }
    .toggleborder:hover img{
    border: 1px solid navy;
    }
    Good luck!

Bookmarks

Posting Permissions

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