Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 02-13-2008, 06:38 PM Nesting Links
Experienced Talker

Posts: 40
Name: james
Trades: 0
I would like to nest 5 links inside each other for a star rating system I am making for my site, like this.

Code:
<a class="5star" href="#">
<a class="4star" href="#">
<a class="3star" href="#">
<a class="2star" href="#">
<a class="1star" href="#">
</a>
</a>
</a>
</a>
</a>
but the browser tries to pair these colored pairs together
Code:
<a class="5star" href="#">
<a class="4star" href="#">
<a class="3star" href="#">
<a class="2star" href="#">
<a class="1star" href="#">
</a>
</a>
</a>
</a>
</a>
when I want it to pair these colored pairs together
Code:
<a class="5star" href="#">
<a class="4star" href="#">
<a class="3star" href="#">
<a class="2star" href="#">
<a class="1star" href="#">
</a>
</a>
</a>
</a>
</a>
Is their any way to make this work?
jamest is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-13-2008, 07:45 PM Re: Nesting Links
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
You can't nest links. It really doesn't make sense since it leaves no way for the browser to determine where the link should go.

You shouldn't need to nest links to create a rating system, though. Could you describe what you want to do with a little more detail. I'm sure we can walk you through creating the rating system or point you to a tutorial or pre-existing script.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 02-15-2008, 04:21 AM Re: Nesting Links
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.w3.org/TR/html401/struct/links.html#h-12.2.2
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-15-2008, 03:01 PM Re: Nesting Links
Experienced Talker

Posts: 40
Name: james
Trades: 0
OK, Thanks. I am pretty sure I can accomplish the same affect by putting links inside of divs and then nesting the divs. When I finish I will post it here so you guys can see what I was trying to do and how I got it to work.
jamest is offline
Reply With Quote
View Public Profile
 
Old 02-15-2008, 09:00 PM Re: Nesting Links
ozzozo's Avatar
Experienced Talker

Latest Blog Post:
Customer Support Whitepaper
Posts: 44
Trades: 0
How about trying a horizontal list?

HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title></title>
<style type="text/css">

#rating li
{
display: inline;list-style-type: none;padding-right: 10px;
}
</style>
</head>

<body>

<ul id="rating">
<li><a href="#">5</a></li>
<li><a href="#">4</a></li>
<li><a href="#">3</a></li>
<li><a href="#">2</a></li>
<li><a href="#">1</a></li>
</ul>

</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
- FAQ Management Software
ozzozo is offline
Reply With Quote
View Public Profile Visit ozzozo's homepage!
 
Old 02-15-2008, 11:27 PM Re: Nesting Links
Experienced Talker

Posts: 40
Name: james
Trades: 0
That wouldn't work for my purposes. The reason I want to nest links is so I can change the background of all links inside a certain link when I hover over it.

EDIT:This is the my new problem and I believe that it is all that is keeping my idea from working.

Why does this work and the image Star_Gold.png shows up.
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
div a {
padding-right:16px;
background:url(/Images/Buttons/Star_Gold.png) no-repeat 0 0;
}
</style>
</head>
<body>
<div class="1star"><a href="#"></a></div>
</body>
</html>
But this does not?
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
div.1star a {
padding-right:16px;
background:url(/Images/Buttons/Star_Gold.png) no-repeat 0 0;
}
</style>
</head>
<body>
<div class="1star"><a href="#"></a></div>
</body>
</html>
EDIT2:I just realized I am an idiot. I have been racking my brains to try and figure out why this didn't work when the only problem is that i started my class names with numbers.

Last edited by jamest; 02-16-2008 at 02:16 AM.. Reason: new question
jamest is offline
Reply With Quote
View Public Profile
 
Old 02-16-2008, 02:20 AM Re: Nesting Links
Mattmaul1992's Avatar
Ultra Talker

Posts: 486
Name: Matt
Trades: -1
So is it all figured out now?
__________________
PHP Code:
$talkupation++; 

Please login or register to view this content. Registration is FREE
- Free IPB forum hosting (releasing today!!!), no ads, free modifications
Mattmaul1992 is offline
Reply With Quote
View Public Profile
 
Old 02-16-2008, 02:37 AM Re: Nesting Links
Experienced Talker

Posts: 40
Name: james
Trades: 0
I'm still working on the final touches but that solved most of my problems.
jamest is offline
Reply With Quote
View Public Profile
 
Old 02-16-2008, 05:54 PM Re: Nesting Links
Experienced Talker

Posts: 40
Name: james
Trades: 0
I would like everyone to know that this is finished and that if you would like to view my resulting star rating system you can view it here.

If you use any of the code from this site please add a to http://jamest.bravehost.com/index.shtml(I am currently working on this site and thus haven't bought a domain name or added any content. I am hoping to have this site finished by the end of the summer.) from your site.

Currently this rating system does not work in IE due to the use of the CSS child selector. For best results it should be viewed with Mozilla Firefox(or other Mozilla based browsers).
jamest is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Nesting Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37737 seconds with 12 queries