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
Block level item needed- not accepted in inline
Old 05-11-2009, 06:10 PM Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
My html looks like this for my menu buttons:

<div id="buttons">
<ol>
<li><a href="home.html" title="Home"><div id="home">Home</div></a></li>
<li><a href="about.html" title="About Us"><div id="about">About Us</div></a></li>
<li><a href="faq.html" title="FAQ"><div id="faq">FAQ</div></a></li>
<li><a href="services.html" title="Services"><div id="services">Services</div></a></li>
<li><a href="portfolio.html" title="Portfolio"><div id="portfolios">Portfolios</div></a></li>
<li><a href="blog.html" title="Blog"><div id="blog">Blog</div></a></li>
<li><a href="contact.html" title="Contact Us"><div id="contact">Contact Us</div></a></li>
</ol>
</div>

When I checked its validation at WC3, it says that divs are block level items and that they cannot be placed within I am assuming the link tags- but/and it could be the list tags.

What is the best way to rewrite the code so it is valid? I need to be able to specifically target each button so that I can do image replacements in css. Right now everything works fine, should I be concerned about how browsers will read the code?/ Can my illegitimate code cause trouble with other elements within my document?

Thank you so much!
mightyjoeape is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-11-2009, 08:13 PM Re: Block level item needed- not accepted in inline
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
divs are block level items and that they cannot be placed within I am assuming the link tags
Correct, you cannot put divs inside of <a> tags - or any other block level element inside an inline element.

Quote:
I need to be able to specifically target each button so that I can do image replacements in css.
You don't need a div to do that. Put the ID on each <a> tag and the css image rollover will work just as well.

So, you'd have this:
Quote:
<li><a id="home" href="home.html" title="Home">Home</a></li>
Quote:
should I be concerned about how browsers will read the code?
YES!!

Quote:
Can my illegitimate code cause trouble with other elements within my document?
It is possible, yes.

Why are you using an ordered list instead of an unordered list ? Are you menu items numbered ???
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 08:25 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
Thank you so much! That makes a lot of since. I forgot that you could ID other kinds of tags.
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 08:37 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
One more question- now that I put the id in the link tags, how should i be calling them out in css? Because #home{ #a home{ a home- none of that is working. It's showing the original text over the top of my images which have been misplaced by a few pixels by I assume the text that is over the top.
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 08:46 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
I tried a # home{ like css edit is seeming to indicate it the correct term, but when I try that the link ceases to be a link (aka isn't clickable) and my replacement image disappears leaving only the unwanted text
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 08:51 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
i was wrong- they are still links (clickable), but my replacement image is nowhere to be found
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 08:53 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
(my image replacements were working perfectly before I fixed the WC3 validation problem located in html- [the beginning of this thread])
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 09:18 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
I just saw your question about ordered vs. unordered lists- No, my menu is not numbered I have the text-decoration: none

I guess I didn't know why one mattered much over the other, and I didn't want my menu links to get in a different order than the one specified in html (not that I think they do in unordered lists) Is there a reason that I should change it- because that would be an easy fix.

Please read thread reply #5-7
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 10:10 PM Re: Block level item needed- not accepted in inline
GeekSpecialties's Avatar
Super Talker

Posts: 132
Name: Leonard
Location: Minnesota, USA
Trades: 0
for image replacement, here is the method I use.
http://www.cssplay.co.uk/menus/flickerfree_mk3.html

View the source, the CSS is in the head for both types of menu displayed on the page. You should be able to get your's to work like this with a few changes.
GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
Old 05-12-2009, 10:16 AM Re: Block level item needed- not accepted in inline
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
I tried a # home
Remove the spaces, it should be a#home and that should work.

Quote:
I guess I didn't know why one mattered much over the other, and I didn't want my menu links to get in a different order than the one specified in html (not that I think they do in unordered lists)
You mis-understand the purpose of an ordered list - it's used to make a NUMBERED LIST, and using text-decoration: none will do nothing, all that does is remove the underline from a link.

Quote:
Is there a reason that I should change it- because that would be an easy fix.
Semantically, it should be an unordered list, since your menu is not a NUMBERED LIST at all.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 05-12-2009 at 10:19 AM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-12-2009, 06:44 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
GeekSpecialties: Thank you, but that is already how I do image replacements. As I said, my image replacements were working just fine until I decided to validate my code.
I tried a#home and I am still having trouble with the text being over the top- aka my
text-indent: -5000 px is not working. (All my code is valid now, and I did change my ol to an ul.)
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-12-2009, 07:57 PM Re: Block level item needed- not accepted in inline
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Ok, so give us a URL or ALL of the code so we can figure out why it's not working.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-13-2009, 11:48 AM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
Alright, here is the url
http://creative-synthesis.com/

I am primarily concerned about the links right now, but if you see any other problems please let me know.
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-13-2009, 03:20 PM Re: Block level item needed- not accepted in inline
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Set your #buttons a to display:block, then the text indent will work properly
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-14-2009, 01:09 PM Re: Block level item needed- not accepted in inline
Experienced Talker

Posts: 48
Name: April
Trades: 0
Thank you! The links look great.
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Block level item needed- not accepted in inline
 

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 8.38837 seconds with 12 queries