Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding href link to image and text

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
US
on my site at
Where I have the images labeled control and capacity how to add an href link to both the text and image and make it so that there is nothing underlined for the link and it doesn't show the link was visited...


<divclass="borderimage1"><FONTcolor="#FFFF80">CONTROL</FONT></div><divclass="borderimage2"><FONTcolor="#FFFF80">CAPACITY</FONT></div>
 
Not sure what that code is you are trying there
Code:
HTML .........
<div class='item'>
<a href='link'>

... text here ...

</a>
</div>

Code:
Style ........
.item{
}

.item a{
	color:#000;
	font-size:16px;
	line-height:20px;
	font-family: Verdana, sans-serif;
	text-decoration: none;
	font-weight:normal;
	font-style:normal;
	text-align:center;
	display:block;
}

.item a:hover{
	color:#000000;
	background-image: url("backgroundImage");
}

Keith
 
I don't see what you're saying? Im just trying to add a link to both the image and the text which says Control, so that when I click on either it goes to the same place

thanks
 
Your image is a background, so basically it all comes down to the link.

Place a link inside your div, and just make it fill the entire width and height of the div. then add a css rule to remove the underline.

Code:
  <div class="borderimage1" ><a href="[URL unfurl="true"]http://link.com/to/page">CONTROL</a></div>[/URL]

then in your css:
Code:
.borderimage1 a:link{
display:block;
height:100%;
text-decoration:none;
color:#FFFF80;
size:23px;
}

.borderimage1 a:visited{
color:#FFFF80;
}

.borderimage1 a:active{
color:#FFFF80
}

.borderimage1 a:hover{
color:#FFFF80;
}

text-decoration controls the underline, or strike-through etc.. of the link text. set it to none, and there's no underline.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
ok with the text-decoration set to none my link under CONTROL is still underlined along with adding it to the .meadowtransport CSS so that "Visit Meadow Lark Transport to lease on Equipment" is underlined as still underlined as well.
 
borderimage1.visited is now active so needs to have it's text-decoration set.

meadowtransport class has only got the colour set to #00f and nothing else.

It is far easier maintaining style in a stylesheet rather than scattering it around pages.

Keith
 
Set the text-decoration to none for the visited state as well.

Also as audiopro mentions don't put CSS all over the place keep it consistent and in blocks. There's no reason to have text-decoration anywhere else but on actual link CSS as no other text has text-decoration. If you need to remove it from links do it so in the links css.

Only if you need to add some type of decoration to some text would you need to place it anywhere else.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Yes, that's fine. How is it not working?

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top