![]() |
CSS Coder/designer question
i want to make my thumbnails with rounded corners - using a transparent png overlay on top of the thumbnail in a <DIV> like this http://host.sonspring.com/png_overlay/
the question is how do you make the actual thumbnail underneath the overlay clickable? |
style the a href
|
Quote:
|
Quote:
in your case, instead of that absolute DIV there can be an absolute A with same css properties of that DIV OR that absolute DIV to have A tag inside of it with 98-100% for width and height of that DIV both cases may ruin current css hierarchy tho if css rules are addressed in hierarchical way and not adjusted to current change. example of hierarchical rule: div.internal div.absolute {...} edit: i maybe off a bit, haven't toyed with css/html long time, principally it's correct. |
would have to apply the href to the top image, or the div that contains them both
|
This has worked for me in the past, just copied and pasted from source code and css file of a live site so it will have some unnecessary code:
HTML: <div class="model"><img src="images/model_01.jpg"><div class="overlay"></div> <a href="#"></a></div> CSS: .model { display:inline; float:left; height:150px; margin:0 0 0 25px; position:relative; width:120px; } .model img { height:150px; width:120px; } .model .overlay { background:url(images/overlay.png) no-repeat; display:block; height:150px; left:0; position:absolute; top:0; width:120px; z-index:2; } .model a { display:block; left:0; height:150px; position:absolute; top:0; width:120px; z-index:4; } |
you cant just apply it to the image underneath.
you can float div on top as the "3rd layer" and positioning it the width and height of the thumbnail. then link that div. that is the best way, if you mean let me clarify: bottom layer: thumbnails 2nd layer (on top): border layer then the 3rd layer would be a block with a link on it or just have the border layer a bg with the linked div inside it. im hopping on a flight but thats the best way i can think of. |
I like the using Javascript for that..
try corner.js or glossy.js http://www.netzgesta.de/corner/ http://www.netzgesta.de/glossy/ http://www.netzgesta.de/index.php |
step 1: get a rounded corner image and the image you want to use and use it like this:
Code:
<div class="whatever">Code:
.whatever{background: transparent url(myimage.jpg) no-repeat;}the same could be accomplished this way: Code:
<div style="background: transparent url(myimage.jpg) no-repeat;"> |
If you are using JavaScript just throw an event listener on the DIV
|
|
Quote:
the problem with using javascript is that lots of surfers have it disabled now, so it wont work for them |
Quote:
I could only find some old stats on w3schools Quote:
|
Quote:
|
| All times are GMT -7. The time now is 05:05 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123