Jump to content

Dvis inside anchors


gffects

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...