hyperlink - Add a link to an image in a css style sheet -


i looking add link image in acss style sheet nagvigate link when image pressed.

the code image is:

 #logo{     background-image: url(images/logo.png);     width: 981px;     height: 180px;     margin-left: auto;     margin-right: auto; 

what code add allow navigate hyperlink? example: if wanted navigate http://home.com

you can not that...

via css url put on background-image image.

via html have add href hyperlink in way:

<a href="http://home.com" id="logo">your logo</a> 

with text-indent , other css can adjust element show image , clicking on go link.


edit:

because i'm sure you're lazy search text-indent , trying code had text on image i'm here again show , explain why solution better:

<a href="http://home.com" id="logo">your logo name</a> 

this block of html seo friendly because have text inside link!

how style css:

#logo {   background-image: url(images/logo.png);   display: block;   margin: 0 auto;   text-indent: -9999px;   width: 981px;   height: 180px; } 

then if don't care seo choose other answer.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -