Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: Custom Background Color for 'Open in New Window'

  1. #21
    Join Date
    Jan 2015
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    I think I still need help with anchors. Here's what I have in my stylesheet:
    Code:
    a:link {font-family: sans-serif; color: #41502c; font-size: 12px;}
    a:visited {font-family: sans-serif; color: #c94b74; font-size: 12px;}
    a:hover {font-family: sans-serif; color: #8f0d37; font-size: 12px;}
    a:active {font-family: sans-serif; color: #3f5a22; font-size: 12px;}
    a:close {font-family: sans-serif; color: #3f5a22; font-size: 12px;}
    I added the 'close' anchor, hoping it would match my other links. Then, I have this in the doc:

    <div id="img1" class="hide"><img src="gs013.jpg"/><a onclick="hideModal('img1');" class="close">Close Window</a></div>

    I'm still getting a small hover on the 'close window' text. Clearly, my talent lies elsewhere...but I really want to understand this and this is my only stumbling block right now.
    Last edited by Beverleyh; 01-13-2015 at 04:50 PM. Reason: formatting

  2. #22
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    OK - here's how you target the link with a "close" class (using your example);
    Code:
    a.close:link {font-family: sans-serif; color: #41502c; font-size: 12px;}
    a.close:visited {font-family: sans-serif; color: #c94b74; font-size: 12px;}
    a.close:hover {font-family: sans-serif; color: #8f0d37; font-size: 12px;}
    a.close:active {font-family: sans-serif; color: #3f5a22; font-size: 12px;}
    You can separate multiple selectors with a comma to apply the same CSS to each;
    Code:
    a.link, a.close:link {font-family: sans-serif; color: #41502c; font-size: 12px;}
    a:visited, a.close:visited {font-family: sans-serif; color: #c94b74; font-size: 12px;}
    a:hover, a.close:hover {font-family: sans-serif; color: #8f0d37; font-size: 12px;}
    a:active, a.close:active {font-family: sans-serif; color: #3f5a22; font-size: 12px;}
    Hope that helps
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. The Following User Says Thank You to Beverleyh For This Useful Post:

    SheriLynn (01-13-2015)

  4. #23
    Join Date
    Jan 2015
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    I added option one code, as option two code changed all my link font sizes and colors to huge and weird (what?!), but option one doesn't seem to work either. I know you have probably spent more time on this than you care to, but would you please look at my source code for:

    http://www.katiebuglove.com/Tutorial...urtaintut.html

    and tell me if you see anything from preventing the 'close window' text from displaying correctly? I even cleared my browser cache twice....

    Additionally, this is what I have added to my stylesheet for open new window:

    Code:
    div.close {width:100%; height:100%; display:block; position:absolute;}
    and
    Code:
    .show { position:fixed; top:0; right:0; bottom:0; left:0; z-index:9999; margin:0; text-align:center; color:#000; background:rgb(255,204,204); background:rgba(255,204,204,.75);) }
    .show img { max-width:100%; max-height:100%; position:absolute; margin:0; top:45%; left:50%; 
    	-webkit-transform:translate(-50%,-50%); -ms-transform:translate(-50%,-50%); transform:translate(-50%,-50%) 
    	}
    .hide { display:none }
    Last edited by Beverleyh; 01-13-2015 at 06:14 PM. Reason: formatting

  5. #24
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    My mistake on the close link CSS - it should look like this (no :link needed);
    Code:
    a.close {font-family: sans-serif; color: #41502c; font-size: 12px;}
    a.close:visited {font-family: sans-serif; color: #c94b74; font-size: 12px;}
    a.close:hover {font-family: sans-serif; color: #8f0d37; font-size: 12px;}
    a.close:active {font-family: sans-serif; color: #3f5a22; font-size: 12px;}
    Also, I'm not sure why you have this line - it isn't being applied to anything so you can take it out;
    Code:
    div.close {width:100%; height:100%; display:block; position:absolute;}
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. The Following User Says Thank You to Beverleyh For This Useful Post:

    SheriLynn (01-13-2015)

  7. #25
    Join Date
    Jan 2015
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    Done and done!

    Thank you for all your help, I appreciate it so much. Now go do something fun, unless this is fun for you, then, just keep on doing this....

Similar Threads

  1. Replies: 7
    Last Post: 04-21-2012, 07:47 PM
  2. Replies: 4
    Last Post: 03-14-2011, 02:20 AM
  3. Color PIcker Widget (YUI Based) open from with in another window?
    By CSF in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 08-03-2009, 10:22 PM
  4. Resolved Smooth Navigational Menu (v1.02) Custom background color for sub menu
    By lanta99 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 03-16-2009, 09:49 PM

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
  •