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 3 of 3
  1. #1
    Banned
    Join Date
    Sep 2011
    Posts
    140
    Thanks
    17
    Thanked 0 Times in 0 Posts

    CSS gone wrong - image dissapearing when clicking

    Hey guys,

    I am trying to make a simple photo gallery.
    I have come up with a concept that I am satisfied with, but having a minor problem with it.

    Here is the code for it:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    
            "http://www.w3.org/TR/html4/strict.dtd">
    
    <TITLE></TITLE>
    
    <META content="charset=windows-1252;text/html" http-equiv="content-type">
    
    <STYLE type="text/css">
    
    	IMG {
    
    		margin-left: 25%;
    
    		position: absolute;
    
    		visibility: hidden
    
    	}
    
    	A:focus IMG {
    
    		visibility: visible
    
    	}
    
    </STYLE>
    
    <DIV>
    
    	<A href="#show">1<IMG alt="" src="1.png"></A>
    
    	<A href="#show">2<IMG alt="" src="2.png"></A>
    
    	<A href="#show">3<IMG alt="" src="3.png"></A>
    
    </DIV>
    Here it is compiled with the 3 images in a zip file:
    http://qfs.mobi/f31597

    The images show up fine when an A link is toggled, however the problem lays with the image dissapearing when one clicks else where.

    Does anyone know how this can be stopped?

  • #2
    New to the CF scene
    Join Date
    Sep 2011
    Location
    OKC, OK
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not going to download a zip file from some random url. Could you post the site somewhere?

    Based on what I'm reading, you're wanting the image to persist after focus is removed from the element. You won't be able to do that with CSS. Reason being, once someone clicks elsewhere, the focus will be on that item. You'll have to do this with javascript.

  • #3
    Banned
    Join Date
    Sep 2011
    Posts
    140
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ronaldroe View Post
    I'm not going to download a zip file from some random url. Could you post the site somewhere?
    Whats wrong Ronald? Has your Norton Anti-Virus subscription ran out?

    The file MD5 is: 2e441450d64839cd49fbbc309c0e76fe


  •  

    Posting Permissions

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