PDA

View Full Version : links not working



wincode
Aug 31st, 2010, 03:30 AM
What are some reasons why a browser might not read an html link tag (<a href="">link</a>)

Links within one of the <div> tags isn't working. The text "link" is showing, but it's not linking to anywhere.

Any help is appreciated.

Doctor_Varney
Aug 31st, 2010, 03:44 AM
Any number of reasons. Could be a misspelling or a tag not closed. Instead of imagining we're all psychic, why not post the offending bit of code, so we can have a look?

In the meantime, run it through the validator (http://www.w3schools.com/site/site_validate.asp) and see if anything comes up. That often fixes these hard to spot human errors.

Dr. V

wincode
Aug 31st, 2010, 04:50 AM
I found the mistake. Thanks a lot for your help :)

wincode
Aug 31st, 2010, 08:29 AM
Hmm, it's not working again :(
Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="featured.css" />
<link rel="stylesheet" href="/template/style.css" type="text/css">
<title>Member list</title>
<META NAME="description" CONTENT="site">
<META NAME="keywords" CONTENT="site">
<style type="text/css">

body{
margin:0;
padding:0;
line-height: 1.5em;
background-color: #f1f1f1;
}

b{font-size: 110%;}
em{color: red;}

#maincontainer{
width: 1000px;
margin: 0 auto;

}

#topsection{
height:142px;
}



#menus{
height: 42px;
max-width:1000px;
margin: 0 auto;
border-bottom: 1px solid #ddd;
background-image: url('/template/menus3.gif');
font-size: 16px;
}

#topsectioninside{
width:1000px;
margin: 0 auto;
border-bottom: 1px solid #ddd;
}

#topsection h1{
margin: 0;
padding-top: 15px;
}

#contentwrapper{
float: left;
width: 100%;

}

#contentcolumn{
margin-left: 210px;
min-width: 750px;
}

#leftcolumn{
float: left;
width: 210px;
margin-left: -100%;
}

#profilewrap{
float: left;
width: 100%;

}

#profilenamewrap{
padding-left: 5px;
margin-left: 70px;
min-width: 200px;
min-height: 80px;
}

#profilepicwrap{
float: left;
width: 70px;
margin-left: -100%;
}

#profilemain{
width: 400px;
margin: 0 auto;

}



#colmain{
width: 750px;
margin: 0 auto;
}
#colwrap{
float: left;
width: 100%;
}

#col2{
margin: 0 200px 0 50px;
background: #C8FC98;
}

#col1{
float: left;
width: 50px;
margin-left: -750px;
background: #C8FC98;
}

#col3{
float: left;
width: 200px;
margin-left: -200px;
background: #FDE95E;
}






#footer{
clear: left;
width: 1000px;
background: #eee;
border-top:1px solid #ddd;
height:42px;
margin: 0 auto;
text-align: center;

}


.innertube{
margin: 10px;
margin-top: 5px;
a:link {color: #ffffff;}
a:visited {color: #ffffff;}
a:active {color: #ffffff;}

}

</style>



</head>
<body>

<div id="topsection"><div id="topsectioninside">
<div id="header">

<div id="logo"><a href="index.php"><img src="/template/logo.png" /></a></div>
<div id="search_header">
<strong><a href="/task/login.htm">Log-in</a> | <a href="/task/register.htm">Register</a></strong>
</div>
<div id="down"></div></div>

<div id="menus">
<center><a href="index.php">Home</a>
| <a href="/task/search.htm">Search</a>
| <a href="/task/members.htm">Profiles</a>
| <a href="/task/links.htm">Links</a>
|&nbsp;<a href="/task/videos.htm">Videos</a>

<a href="/task/members.htm">Member list</a></center></div>
</div>
</div>



<div id="maincontainer">



<div id="contentwrapper">
<div id="contentcolumn">

<div class="innertube"><a href="http://www.website.com/">Link</a>
</div>
</div>
</div>

<div id="leftcolumn">
<div id="profilemain">
<div id="profilewrap">
<div id="profilenamewrap">
<a href="/profile/Firstname-Lastname.htm"><b>Firstname Lastname</b></a>
<br/><a href="profile/Firstname-Lastname.htm">Profile</a> <br/>
<a href="task/messages.htm">Messages</a> (0) <br/>

</div>
</div>
<div id="profilepicwrap">
<a href="/profile/Firstname-Lastname.htm">
<img src="/avatars/profilepicture.jpg" width="70px" height="70px"/>
</a>
</div>
</div><br/><a href="/login.php?action=logout">Log-out</a> <br/>
</div>
</div>



<div id="footer">
Footer
</div>
</body>
</html>

I hope you can help please, anyone, and thanks a lot for your time.

cineweekly.com
Aug 31st, 2010, 08:53 AM
I'm scanning the code but it would help if you noted which link I'm looking for.

Also, is there any specific reason you use .htm instead of .html?

wincode
Aug 31st, 2010, 09:15 AM
Oh sorry, I forgot!
The link that doesn't work is
<a href="http://www.website.com/">Link</a>

And no reason in using .htm. I'm using a script that had the pages as .htm

wincode
Aug 31st, 2010, 09:36 AM
It seems like it only doesn't work in firefox right now.

met
Aug 31st, 2010, 12:19 PM
css

look



.innertube {
margin: 10px;
margin-top: 5px;
a:link {
color: #ffffff;
}

a:visited { color: #ffffff; }

a:active { color: #ffffff; }
}
</style>



your curly bracers are messed up

fix this

in fact most of your css is farily mesed up

#leftcolumn is 221px wide yet you have elements inside it that are over 400px;

#profilemain is pushing itself on top of the "link" that isn't working, remove this, link is fine.

i'd have a rethink about what you're trying to achieve here, the markup is messy

hotstarpromo
Aug 31st, 2010, 11:05 PM
Hey did you fix it?

wincode
Sep 1st, 2010, 02:44 AM
Yup, all fixed :)