Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Lionsanime Directory   1,000 Directory Submissions   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 12-05-2007, 04:48 PM   #1 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
Borders & Background on rollover

Hi guys,

I have a quick question. I'm running a site in all html, and I was wondering if there is a way to have a border on hover.

Here is what I have now:

Code:
<p style="border: 1px solid #9099AB; padding: 0px 0px 0px 0px; background-color: #BFCFE6; padding-left: 0px; padding-right: 0px;"><a href="http://www.mysite.com/">My Site</a></p>
If you're unsure of what I'm trying to say, check out the windows update site. Their links on the left is basically what I want to do. Only in HTML

Thanks.
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 12-05-2007, 06:40 PM   #2 (permalink)
v7n Mentor
 
searchbliss's Avatar
 
Join Date: 03-25-06
Posts: 762
iTrader: 1 / 100%
searchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nicesearchbliss is just really nice
I'm not sure you can do this with the code above. You can use DHTML or Javascript to make a table border around the link show using the "OnMouseOver" and "OnMouseOff" events.
__________________
SearchBliss Web Tools - SEO Tools, Web Design Tools, Free Website Content...
searchbliss is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-05-2007, 06:44 PM   #3 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
Alright, Any ideas for the code or where to point me?
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 01:04 AM   #4 (permalink)
Contributing Member
 
Join Date: 09-03-07
Location: England
Posts: 425
iTrader: 0 / 0%
Latest Blog:
None

Boogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the rough
this will work:

Code:
<p style="border: 1px solid #9099AB; padding: 0px 0px 0px 0px; background-color: #BFCFE6; padding-left: 0px; padding-right: 0px;"><a href="http://www.mysite.com/">My Site</a></p>
Change your code to the following code:

FIRST CSS
Code:
a p { border: 1px solid #9099AB; padding: 0px 0px 0px 0px; background-color: #BFCFE6; padding-left: 0px; padding-right: 0px; } a p:hover { border:4px solid #000000; }
NOW HTML
Code:
<a href="mysite.html"><p>My site</p></a>
This will work as i've tested it.

HTH's
Boog's
__________________
Great new 'June' Javascript Framework

June Forums - Innovative JScripting

Price is what you pay... Value is what you get.
Boogle is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 03:32 PM   #5 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
Alright, I'm a little confused about that script. For CSS on the top of my page I have the following
Code:
<style type="text/css"> <!-- #Layer1 { position:absolute; left:20px; top:38px; width:105px; height:197px; z-index:1; background-color: #FFFFFF; a p { border: 1px solid #9099AB; padding: 0px 0px 0px 0px; background-color: #BFCFE6; padding-left: 0px; padding-right: 0px; } a p:hover { border:4px solid #000000; } } --> </style>
And then in the layer I have the links. Is something wrong?
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 03:50 PM   #6 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,927
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
just change the a with p in the code above, like this:

Code:
P A { .. the code from above...} P A:hover { .. the code from above...}
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 04:29 PM   #7 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
For some reason neither of those are working. Right now in my style.css sheet I have:

Code:
#Layer1 { position:absolute; left:20px; top:38px; width:105px; height:197px; z-index:1; background-color: #FFFFFF; P A { border: 1px solid #9099AB; padding: 0px 0px 0px 0px; background-color: #BFCFE6; padding-left: 0px; padding-right: 0px; } P A:hover { border:4px solid #000000; } }
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 04:33 PM   #8 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,927
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
that's weird... hmm
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 04:34 PM   #9 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
Perhaps it's not compatible with firefox? ..Let me try out some other browsers
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 04:34 PM   #10 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,927
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
update: you've forgotten to add the } here:
Code:
#Layer1 { position:absolute; left:20px; top:38px; width:105px; height:197px; z-index:1; background-color: #FFFFFF; }
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 04:37 PM   #11 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
:/ Nope, still nothing on IE, Firefox and Safari
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 04:41 PM   #12 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,927
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
ok. let me try again:
what element you want bordered here? the P or the A ?
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 05:33 PM   #13 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,927
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
anyway...

Check the code I provided and adjust it to suit your needs. If you want other element to share that styles, just replace the current element "p" with the one you want.

this adds a border to your "p" element:


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Your Page Name Here</title> <style type="text/css"> #Layer1 { position:absolute; left:20px; top:38px; width:105px; height:197px; z-index:1; background-color: #FFFFFF; } #Layer1 P { border: solid 1px #9099AB; padding: 0px 0px 0px 0px; background-color: #BFCFE6; padding-left: 0px; padding-right: 0px; } #Layer1 P:hover { border: solid 3px #ff0000; } </style> </head> <body> <div id="Layer1"> <p> <a href="http://www.mysite.com/">My Site</a></p> </div> </body> </html>
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 05:47 PM   #14 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
I'm sorry, it does work now that I put the ending bracket. I missed that post.
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-06-2007, 06:01 PM   #15 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
One more question. Is there a way to set that just for the layer that I have? It is also changing the background and rollovers of my normal links as well.
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-07-2007, 12:45 AM   #16 (permalink)
Contributing Member
 
Join Date: 09-03-07
Location: England
Posts: 425
iTrader: 0 / 0%
Latest Blog:
None

Boogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the rough
Quote:
Originally Posted by bswinnerton View Post
One more question. Is there a way to set that just for the layer that I have? It is also changing the background and rollovers of my normal links as well.
There's no way that the code Costin Trifan posted, will be changing your background color: the hover element is only changing your border attributes. Is your code different to his?

Boog's
__________________
Great new 'June' Javascript Framework

June Forums - Innovative JScripting

Price is what you pay... Value is what you get.
Boogle is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-07-2007, 08:36 AM   #17 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
Yes, I'm sorry I forgot to mention that

Is there any way to make it so it only changes the layer and not all of my page?
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-07-2007, 08:37 AM   #18 (permalink)
Contributing Member
 
Join Date: 09-03-07
Location: England
Posts: 425
iTrader: 0 / 0%
Latest Blog:
None

Boogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the rough
yes, within the hover declaration you must change all the styles you want to change? Is thatwhat you mean?
__________________
Great new 'June' Javascript Framework

June Forums - Innovative JScripting

Price is what you pay... Value is what you get.
Boogle is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-07-2007, 09:21 AM   #19 (permalink)
Inactive
 
Join Date: 10-21-07
Posts: 20
iTrader: 0 / 0%
Latest Blog:
None

bswinnerton is liked by many
Yes I believe so. So would I still be using the A or P? For example all of my links in my layer1 are .style2, so I'm not sure if i'd still use A or P
bswinnerton is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Borders - different size in FF and IE6 Emsan Coding Forum 7 03-21-2008 11:04 AM
Rounding corners of borders devilzfan300 Coding Forum 9 03-11-2008 01:50 AM
Images as borders sinster Coding Forum 4 09-16-2007 09:35 PM
Inner Table Borders fstop71 Coding Forum 14 09-13-2004 08:55 AM
CSS table borders and scrollbar colors Pretend Coding Forum 12 10-16-2003 02:03 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:21 PM.
© Copyright 2008 V7 Inc