Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > CSS
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 11-12-2009, 09:06 PM
  #1
ryandevilhorns
Novice (Level 1)
 
ryandevilhorns's Avatar
 
Join Date: Nov 2009
Location: socal.
Posts: 3
iTrader: (0)
ryandevilhorns is an unknown quantity at this point
Indenting LI items

Hi there,

I'm hoping someone can help me figure out how to make some LI items indent slightly more each level down. Something like this is what I'm looking for:



I wasn't having much luck finding any examples Googling unfortunately, I'm a novice at CSS and unsure what the exact term would be.

Is it possible for the CSS to have some logic so that the LI item knows its position in the UL and can indent appropriately?

If not, I would then have to define the indent for each level in the CSS and then call it with a class for each level?

Hope that all makes sense.
Thanks.
ryandevilhorns is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 11-13-2009, 02:52 AM
  #2
Pegasus
Extremely Flighty Admin
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 21,472
iTrader: (0)
Pegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to all
Try adding margin: 5px; to each <li>, like this:

<li style="margin: 5px;">Item 1</li>
<li style="margin: 10px;">Item 2</li>

And so on.
__________________


Decaf is the root of all evil...
HTMLForums Awards 2008
Pegasus is online now   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 11-13-2009, 03:00 AM
  #3
¥åßßå
Blonde Bimbo
 
¥åßßå's Avatar
 
Join Date: Jul 2004
Posts: 2,243
iTrader: (0)
¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all
Or nest lists :

HTML Code:
<ul>
<li>item 1</li>
<li>Item 2
  <ul>
  <li>Item 2a</li>
  <li>Item 2b><li>
  </ul>
</li>
<li>Item 3</li>
</ul>
¥
__________________
I may have opened the door, but you entered of your own free will

¥åßßå is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 11-13-2009, 02:11 PM
  #4
ryandevilhorns
Novice (Level 1)
 
ryandevilhorns's Avatar
 
Join Date: Nov 2009
Location: socal.
Posts: 3
iTrader: (0)
ryandevilhorns is an unknown quantity at this point
Quote:
Originally Posted by ¥åßßå View Post
Or nest lists :

HTML Code:
<ul>
<li>item 1</li>
<li>Item 2
  <ul>
  <li>Item 2a</li>
  <li>Item 2b><li>
  </ul>
</li>
<li>Item 3</li>
</ul>
¥
I thought about trying that, but I have a different bullet icon for nested lists defined in my global css, I'd like the effect I asked about to be just on one page. Thanks though.

Quote:
Originally Posted by Pegasus View Post
Try adding margin: 5px; to each <li>, like this:

<li style="margin: 5px;">Item 1</li>
<li style="margin: 10px;">Item 2</li>

And so on.
I think this is what I'm looking for, thanks for your help.
ryandevilhorns is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 11-13-2009, 02:17 PM
  #5
¥åßßå
Blonde Bimbo
 
¥åßßå's Avatar
 
Join Date: Jul 2004
Posts: 2,243
iTrader: (0)
¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all¥åßßå is a name known to all
Just override your global css?

HTML Code:
<style type="text/css">
.foo,
.foo ul{
list-style:none;
margin:0 0 0 1em;
}
</style>

...

<ul class="foo">++ rest of my example
¥
__________________
I may have opened the door, but you entered of your own free will

¥åßßå is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 11-13-2009, 04:36 PM
  #6
ryandevilhorns
Novice (Level 1)
 
ryandevilhorns's Avatar
 
Join Date: Nov 2009
Location: socal.
Posts: 3
iTrader: (0)
ryandevilhorns is an unknown quantity at this point
Quote:
Originally Posted by ¥åßßå View Post
Just override your global css?

HTML Code:
<style type="text/css">
.foo,
.foo ul{
list-style:none;
margin:0 0 0 1em;
}
</style>

...

<ul class="foo">++ rest of my example
¥
Thanks for the follow-up, let me play around with this and do some further reading. The other examples I can visualize, but I'm unfamiliar with this formatting and can't visualize it.
ryandevilhorns is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 06:24 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.