Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 11-27-2010, 05:58 PM   #1
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
CSS problem - what am i doing wrong?

I'm trying to put a single pixel border around thumbnails with some padding between the thumbnail and border - and on hover the border will change color.

so i did this

a.blah:link
{border: 1px solid #000;
padding: 4px;
}

a.blah:hover
{border: 1px solid #FFF;
padding: 4px;
}

and......

<a href="file.wmv" class="blah"><img src="thumbnail.jpg" border="0"></a>

what the result is - there's a single border with the 4px padding but the border doesn't surround the entire thumbnail, it's only like 10 pixels in height.

__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 06:03 PM   #2
TheDoc
Too lazy to set a custom title
 
TheDoc's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
May be some hack in way to do it... but easiest way across all browsers would be to wrap the picture in a div, which has your pad and border, then hover that div.

set a width/height on the a in css to fix the height issue..
__________________
~TheDoc - ICQ7765825
It's all disambiguation

Last edited by TheDoc; 11-27-2010 at 06:04 PM..
TheDoc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 06:09 PM   #3
Kiopa_Matt
Confirmed User
 
Industry Role:
Join Date: Oct 2007
Posts: 1,448
I'm no designer, so there's a chance this won't work, but try changing your HTML to:

<span class="blah"><a href="file.wmv"><img ... ></span>

Then in your CSS, add in the attribute "display: block;"

Don't scold me if that doesn't work though.
__________________
xMarkPro -- Ultimate Blog Network Management
Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!
Kiopa_Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 06:15 PM   #4
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
yeah.. thumbs etc. are a freakin pain in the ass for hovers etc. Maybe try this.. Note you need to set the width and height.

Code:
a.blah:link,a.blah:hover,a.blah:active{
	width:XXpx;
	height:XXpx;
	border:1px solid #00f;
	text-decoration:none;
	padding:4px;
	display:block;
}

a.blah:hover{
	border:1px solid #f00;
}
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 06:36 PM   #5
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Quote:
Originally Posted by Tempest View Post
yeah.. thumbs etc. are a freakin pain in the ass for hovers etc. Maybe try this.. Note you need to set the width and height.

Code:
a.blah:link,a.blah:hover,a.blah:active{
	width:XXpx;
	height:XXpx;
	border:1px solid #00f;
	text-decoration:none;
	padding:4px;
	display:block;
}

a.blah:hover{
	border:1px solid #f00;
}

thanks - display: block solved it - when i added height and width it messed up the padding - the top and side paddings were the same but the bottom padding was larger.

thanks for the other suggestions, they probably work too.
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 06:43 PM   #6
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Quote:
Originally Posted by Mutt View Post
thanks - display: block solved it - when i added height and width it messed up the padding - the top and side paddings were the same but the bottom padding was larger.
You have to take into account the padding and border width usually when doing the width/height.
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 07:04 PM   #7
Simon
Confirmed User
 
Simon's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Florida's Kinky Keys
Posts: 189
Quote:
Originally Posted by Mutt View Post
I'm trying to put a single pixel border around thumbnails with some padding between the thumbnail and border - and on hover the border will change color.
You can do it by putting the class on the Image tag instead of the Anchor/Link tag.

Code:
<style type="text/css">
a img.thumb {border:1px solid #000; padding:4px;}
a:hover img.thumb {border:1px solid #fff; padding:4px;}
</style>

<a href="file.wmv"><img class="thumb" src="thumbnail.jpg" border="0" width="300" height="200" /></a>
__________________
See most arguments on GFY explained in about 5 seconds
email: simon <at> IndustryInc dot com | icq: 269~043~019
"If you want a happy ending, that depends, of course, on where you stop your story."
Simon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 07:30 PM   #8
Kiopa_Matt
Confirmed User
 
Industry Role:
Join Date: Oct 2007
Posts: 1,448
Not even a quick thank you to me for solving your problem?

Dick... didn't your mom teach you manners? :P

PS. Don't worry, I'm just drunk & joking.
__________________
xMarkPro -- Ultimate Blog Network Management
Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!

Last edited by Kiopa_Matt; 11-27-2010 at 07:44 PM..
Kiopa_Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-27-2010, 07:56 PM   #9
munki
Do Fun Shit.
 
munki's Avatar
 
Industry Role:
Join Date: Dec 2004
Location: OC
Posts: 13,393
I love cock swallowing sluts.
__________________

I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde
munki is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.