The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Problem with Simple Hyperlink, I have 1 link of that won't show as active
Tony D
post Mar 17 2017, 06:08 AM
Post #1





Group: Members
Posts: 1
Joined: 17-March 17
Member No.: 26,346



Ok, I am going to try and explain this best I can. I have a header withe 4 links. Home, About,Gallery & Contact. 3 of them work fine but Home will not show as active when rolled over by mouse. Here is a link to the page: My Webpage I can post the code if anyone wants to see it. I have gone over it character by character and cannot see why it is not working. This in a PHP header I have included into all my pages. It is not just 1 page, it is all. If is bring up the header alone it doesn't work so I do not believe it is a crossover problem from other code. Please help, this is making me crazy. Thanks in advance.

<table width="100%">
<tr>
<td width="25%>
<a href="index.php"><div align="center"><img src="images/homecs.jpg" width="200" height="50" alt="" title="" /></div></a>
<br><br>
<a href="about.php"><div align="center"><img src="images/aboutcs.jpg" width="200" height="50" alt="" title="" /></div></a></td>
<td><div align="center"><img src="images/ann3.gif" width="500" height="400" alt="" title="" /><br><img src="images/namelogo.jpg"/><br><br></div></td>
<td width=25%>
<a href="artwork/index.php" target="_blank"><div align="center"><img src="images/gallerycs.jpg" width="200" height="50" alt="" title="" /></div></a>
<br><br>
<a href="contact.php"><div align="center"><img src="images/contactcs.jpg" width="200" height="50" alt="" title="" /></a></td>
</tr>
</table>

This post has been edited by Tony D: Mar 17 2017, 06:33 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 17 2017, 08:15 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



It's because you've forgotten the closing quote for the attribute before that link. Here.

CODE
<td width="25%>
             ^


That makes the browser see the value for width like this.

CODE
<td width="25%><a href="


And what comes after becomes pointless like this.

CODE
index.php">



Also, those DIVs aren't needed. You can use the align attribute for TD.
http://htmlhelp.com/reference/html40/tables/td.html

The DIVs are just redundant. Another problem is that while block level elements like DIV are allowed inside inline elements like A in HTML5 (that's the doctype you use), that is not the case with other versions of HTML. And you don't write HTML5 so you shouldn't use that doctype. HTML 4.01 Transitional would fit better. With a doctype that corresponds to the actual flavor of HTML you use, you can use a validator and find errors like the missing quote easily. With the wrong doctype you'll get oodles of non important errors and the validator output becomes very hard to read.


Validators
http://htmlhelp.com/reference/html40/ (doesn't do HTML5, but has a better output IMO)
https://validator.w3.org/

Doctypes
http://htmlhelp.com/tools/validator/doctype.html (the HTML5 one is missing, but you know that one already)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 03:13 AM