This is a discussion on "[SOLVED] styling a div with a link and hover" within the Web Page Design section. This forum, and the thread "[SOLVED] styling a div with a link and hover are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] styling a div with a link and hover
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] styling a div with a link and hover
Sorry for this question if its dumb, Im relatively new to css so I'm hoping someone can help. I am setting up a gallery with an image and text contained inside a div called thumbnail.
I want to create a link for each div container, but I also want a hover state on the div which fills with a colour (but doesn't effect the image inside). I'm not sure how to go about adding a link to the each div with a hoverstate. Please find the link to the page here, http://www.twistedjunkie.eclipse.co.uk/gallery.html thanks.. lister |
|
|
|
#2
|
|||
|
|||
|
Re: styling a div with a link and hover
You could set the display: block property on the link (a { ... } ) with a width and height ...
|
|
#3
|
|||
|
|||
|
Re: styling a div with a link and hover
sorry for my lack of CSS, how do you go about adding a link to the div area (im using dreamweaver at the mo) without effect the content inside. at the moment I have a div class called thumbnail.
Last edited by karinne; Oct 31st, 2007 at 11:57. Reason: To display code in posts, use the vBcode tags ;) |
|
#4
|
|||
|
|||
|
Re: styling a div with a link and hover
This works
|
|
#5
|
|||
|
|||
|
Re: styling a div with a link and hover
Thanks alot for that, I noticed you changed the .thumbnail css contents with the .thumbnail a css contents and also created a new thumbnail a img with a border of 0. At the moment Im trying to work out how this works...
|
|
#6
|
|||
|
|||
|
Re: styling a div with a link and hover
Oh right ... I wanted to describe what I did but then this piece of crap that people call computer froze on me ... again ...
So ... yes ... basically I moved everything you had in .thumbnail { } to .thumbnail a { } except for the text-align property. I had to add the .thumbnail a img { } to remove the white border it was creating around that image. hth |
|
#7
|
|||
|
|||
|
Re: styling a div with a link and hover
Thanks for all your help, problem solved... Top forum!!!!!!
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] magical ie6 hover states | AndrewChip | Web Page Design | 1 | Mar 31st, 2008 13:03 |
| a:link, active, hover, visited.... | mcdanielnc89 | Web Page Design | 35 | Nov 8th, 2007 22:10 |
| styling my form (problem) - link | danny322 | Web Page Design | 9 | Nov 8th, 2007 01:22 |
| [SOLVED] Styling more than one list | Lchad | Web Page Design | 7 | Nov 2nd, 2007 06:09 |
| CSS Hover on individual Link (li) ??? | j4mes_bond25 | Web Page Design | 1 | Jun 14th, 2006 21:08 |