SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    563
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How to create simple ul li menu ?

    Hello,

    I have simple <a href links in a div like this:

    <div>
    <a href="somelink1.html">Link 1</a> |
    <a href="somelink2.html">Link 2</a> |
    <a href="somelink3.html">Link 3</a>
    </div>

    How to make it using <ul> and <li> so that | comes automatically using css ?

    Thanks.

  2. #2
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, you mean something like this?

    Code CSS:
    #navcontainer
    	{
    		margin-left: 30px;
    		margin-bottom: 1em;
    		overflow: hidden;
    		width: 460px;
     
    	}
     
    	#navlist
    	{
    		list-style-type: none;
    		margin: 0;
    		padding: 0;
    	}
     
    	#navlist li
    	{
    		border-left: 1px solid #000;
    		float: left;
    		line-height: 1.1em;
    		margin: 0 .5em 0 -.5em;
    		padding: 0 .5em 0 .5em;
    	}

    Code HTML4Strict:
    <div id="navcontainer">
    	<ul id="navlist">
    		<li id="active"><a href="#" id="current">Item one</a></li>
    		<li><a href="#">Item two</a></li>
    		<li><a href="#">Item three</a></li>
    		<li><a href="#">Item four</a></li>
    		<li><a href="#">Item five</a></li>
    	</ul>
    </div>
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need

  3. #3
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    563
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Perfect! Thanks, after some alteration i got it what i wanted.

    Thanks.

  4. #4
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No prob. Glad it worked
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •