It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

List items inside a span are casuing me validation problems.

List items inside a span are casuing me validation problems.

Postby johnyct9760 on Thu Feb 26, 2009 3:05 pm

Hi every one I have a quick question. I'm building and interface this is make of unordered list items. Those list items are contained in a span so that interface can have separate look for the other links on the page.

But when I validate my page in Dreamweaver I get some page errors that.

Here is the error:

[COLOR="Red"]The tag:"span" is not allowed within: "ul" It is only allowed within: a, abbr, acronym, address, b, bdo, big, button, caption, cite, code, dd, del, dfn, div, dt, em, fieldset, h1, h2, h3, h4, h5, h6. . ..[XHTML 1.0 strict][/COLOR]

Now here is the code in question:
[HTML]
<ul id="nav">
<span class="left_links">
<li class="nav_items_00"><a href="index.html">Home</a></li>
<li class="nav_items_00"><a href="services.html">Services</a></li>
<li class="nav_items_00"><a href="gallery.html">Gallery</a></li>
<li class="nav_items_00"><a href="events.html">Events</a></li>
<li class="nav_items_00"><a href="http://hsgsphoto.wordpress.com/" target="_blank">Blog</a></li>
<li class="nav_items_00"><a href="about.html">About</a></li>
</span>
[/HTML]
The page that you can see this code in action is located at:

[url="http://www.hsgsphoto.com"]http://www.hsgsphoto.com[/url]

I guess my question is what would be the best practice in this situation. I need the a way to tell this group of links to act different then links in other parts of the page but the error I'm getting in validation is that list items (li) tags are not to be used within a span.

Thank you so much for any feed back and help

John
User avatar
johnyct9760
 
Posts: 22
Joined: Sun Mar 02, 2008 5:21 am
Location: USA, Michigan

Re: List items inside a span are casuing me validation problems.

Postby rangana on Thu Feb 26, 2009 3:21 pm

In the "ul" element, it is only the "li" element that are allowed to descend right next to it.

So, what you're doing is invalid and will never pass validation.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Re: List items inside a span are casuing me validation problems.

Postby igjoe on Thu Feb 26, 2009 7:23 pm

Go to your css and copy all your attributes from the nav_items_00 class and paste them into the left_links (delete the attributes that are duplicates). Then just write your code like this:

[HTML]
<ul id="nav">
<li class="left_links"><a href="index.html">Home</a></li>
<li class="left_links"><a href="services.html">Services</a></li>
<li class="left_links"><a href="gallery.html">Gallery</a></li>
<li class="left_links"><a href="events.html">Events</a></li>
<li class="left_links"><a href="http://hsgsphoto.wordpress.com/" target="_blank">Blog</a></li>
<li class="nav_items_00"><a href="about.html">About</a></li>
</ul>
[/HTML]

is that what you are looking for?
User avatar
igjoe
100+ Club
 
Posts: 124
Joined: Tue Jan 06, 2009 4:14 pm
Location: Minneapolis, MN

Re: List items inside a span are casuing me validation problems.

Postby johnyct9760 on Thu Feb 26, 2009 9:24 pm

If I delete the attributes:

Code: Select all
.left_links a:link {
   color: #c0c0c0;
   text-decoration:none;   
}
.left_links a:visited {
   color: #c0c0c0;
   text-decoration:none;
}
.left_links a:active {
   color: #c0c0c0;
   text-decoration:none;   
}
.left_links a:hover {
   color: white;
   background-color:#C62F2A;
   text-decoration:underline;
   display:block;
}


then how am I going to get the interface to work when people scroll over it? I'm not sure what your gunning for in your response?
User avatar
johnyct9760
 
Posts: 22
Joined: Sun Mar 02, 2008 5:21 am
Location: USA, Michigan

Re: List items inside a span are casuing me validation problems.

Postby igjoe on Fri Feb 27, 2009 4:43 pm

you want to keep the ones that you have already in your left_links class. The deleting of attributes will only be done after you copy all the attributes over from your other class (nav_items_00). Only delete attributes if you have duplicates like they both have a color attribute, but you want to keep your left links one.

Made up Example:


.left_links a:link {
color: #c0c0c0;
text-decoration:none;
}

.nav_items_00 a:link {
color: #999999
text-decoration:none;
font-size: 10px;
}

*now COPY the nav_items attributes and paste into left_links (Don't cut, because you want to keep your other attributes where they are)

.left_links a:link {
color: #c0c0c0;
text-decoration:none;
color: #999999
text-decoration:none;
font-size: 10px;
}

.nav_items_00 a:link {
color: #999999
text-decoration:none;
font-size: 10px;
}


*Now delete the duplicates that you don't need

.left_links a:link {
color: #c0c0c0;
text-decoration:none;
font-size: 10px;
}

.nav_items_00 a:link {
color: #999999
text-decoration:none;
font-size: 10px;
}

That is what I was talking about doing. Maybe I didn't understand your question correctly, but this is what i believe my solution would be if I have the problem right.
User avatar
igjoe
100+ Club
 
Posts: 124
Joined: Tue Jan 06, 2009 4:14 pm
Location: Minneapolis, MN

Re: List items inside a span are casuing me validation problems.

Postby johnyct9760 on Fri Feb 27, 2009 11:42 pm

Thx you I will give it a try and see how it turns out thx you for the extra clarification.

John
User avatar
johnyct9760
 
Posts: 22
Joined: Sun Mar 02, 2008 5:21 am
Location: USA, Michigan

Re: List items inside a span are casuing me validation problems.

Postby igjoe on Sat Feb 28, 2009 2:31 pm

No prob. Hope it works out.
User avatar
igjoe
100+ Club
 
Posts: 124
Joined: Tue Jan 06, 2009 4:14 pm
Location: Minneapolis, MN


Who is online

Users browsing this forum: No registered users and 3 guests