Jump to content

unorder list css3 simple menu


Isset1988

Recommended Posts

Hello my friends,

 

I want to create a vertical menu with some categories and some subcategories.

 

My script produses a little strange the unordered list structure. (there is no way to change this)

<ul>	
	<li>
		<a href="#">
			Category 1
		</a>
	</li>	
	<li>
		<a href="#">
			Category 2
		</a>
	</li>
	        <ul>
		  <li>
			<a href="#">
				SubCategory 2.1
			</a>
		  </li>
		</ul>
		<ul>
		  <li>
			<a href="#">
				SubCategory 2.2
			</a>
		</li>
	       </ul>
	<li>
		<a href="#">
			Category 3
		</a>
	</li>
</ul>

Can someone help me to create a simple css 3 menu.

 

Thank you !

Edited by Isset1988
Link to comment
Share on other sites

Thank you for your answer requinix.

The proper/valid html is:
 

<ul>

<li>
    <a href='#'> Category </a>
    <ul>
        <li><a href='#'> Sub Category </a></li>
    </ul>
</li>

</ul>

Is there any solution without have the subcategory nside the category?

Edited by Isset1988
Link to comment
Share on other sites

If the browser corrects your HTML then you can treat it as if it were valid. Use something to inspect the HTML structure of the page (like Chrome's Inspector thing) to make sure the

    was moved into the
  • . Assuming it does so then you can write your CSS as if the markup was valid.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.