Jump to content

Recommended Posts

Posted

Hi there I was trying to make a new kind of navigation and this time i made my ul and li have a div inside of the anchor tag and it works great but according to w3c this is not allowed is there anyway to bypass this. the code is as follows:

 

<div id="navigation"><ul>

<li><a href="#"><div id="home"></div></a></li>

<li><a href="#"><div id="portfolio"></div></a></li>

<li><a href="#"><div id="contact"></div></a></li>

<li><a href="#"><div id="about"></div></a></li>

<li><a href="#"><div id="testimonials"></div></a></li>

<li><a href="#"><div id="services"></div></a></li>

<li><a href="#"><div id="blog"></div></a></li>

<li><a href="#"><div id="rss"></div></a></li>

 

</ul></div>

 

The reason I tried to do it this way was that I could use the divs image as the buttons so I could make it look like whatever I please without too much coding involved.

Perhaps if its was the button tag insted of a div tag it may work any advice would be greatly appreciated.

Posted (edited)

Use <span> tags instead. Of course you don't have to use span tags...why not apply your image buttons to the anchor tags?

 

<div id="navigation">

<ul>

<li><a href="#" id="home"></a></li>

<li><a href="#" id="portfolio"></a></li>

<li><a href="#" id="contact"></a></li>

<li><a href="#" id="about"></a></li>

<li><a href="#" id="testimonials"></a></li>

<li><a href="#" id="services"></a></li>

<li><a href="#" id="blog"></a></li>

<li><a href="#" id="rss"></a></li>

 

</ul></div>

 

Just use css to apply your image buttons including any hover effect.

Edited by Eddie
Posted

so use them in exactly the same way as the divs? just span then change the css to the span ids thanks i'll do that and test it again.

Read my last post again because I have since edited it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...