We help IT Professionals succeed at work.

HREF for image & 3 lines of text ...

bleggee
bleggee asked
on
I am stumped ... How can I make this image and the 2-3 lines of text 'clickable"  ?   Do I have to HREF each individual item, or is there a way to wrap this whole set of code with 1 HREF, possibly using DIV tags?

I inherited the code ... it looks something like this:

              <a href="#">
                <div class="features-head">
                  <img src="img/thumb.jpg" alt=" ">                       
                </div>
                <div class="description-first">
                  <h4>Electrician</h4>
                  <p>Redesign and update your home</p>
                  <p>Be the first in your neighborhood</p>
                </div>
            </a>

Of course I tried changing the first line to:
<a href="pagename.php">
which didn't work.
Comment
Watch Question

Most Valuable Expert 2011
Top Expert 2016

Commented:
Does this exist somewhere "in situ" so we can see the complete picture?  I can see nothing wrong with your anchor tag, so I think there may be something else involved that is causing your "clickable" issues.

Author

Commented:
Sure.   If nothing obvious pops out to you, I am going to troubleshoot a little more. Learn stuff that way !  ;)   If I can't fix or isolate the issue, I'll send the info for the site page etc.
Kim WalkerWeb Programmer/Technician

Commented:
This would depend on what doctype you're using. The code you've presented is valid in HTML 5, but not in previous versions of HTML.
Most Valuable Expert 2011
Top Expert 2016
Commented:
This works the same in HTML4 Transitional and HTML5.  These are the two I see most often; didn't test other doctypes.
https://iconoun.com/demo/temp_bleggee_html4.php
https://iconoun.com/demo/temp_bleggee_html5.php

Author

Commented:
Interesting about the HTML 4 vs 5. Looks like I have DOCTYPE for 5.

Here's the link to the test site. I am stumped:  http://responsivehost.com/
In the index.php file, there are 2 rows of 4. Top row links are not working. Bottom row of links are working fine.
I've attached the index.php and the 3 include files in case you need them.

Any help is appreciated!
RespHost.zip
Kim WalkerWeb Programmer/Technician
Commented:
The problem is that a javascript error is being thrown whenever you click on the linked group of elements. The error is related to flexslider but I can't find any flexslider configuration. But then I'm not that familiar with flexslider so it may be able to work without any custom configuration. Do you intend to use flexslider on these linked groups of elements and what flexslider effect do you hope to trigger by clicking the linked elements group?
NerdsOfTechTechnology Scientist
Commented:
try linking the LI elements instead.

<a href="test.php"><li>
...
</li></a>

Open in new window

Author

Commented:
Thx all!