Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
CSS: lists text indent
Old 04-28-2005, 02:04 PM CSS: lists text indent
Recrehal's Avatar
Experienced Talker

Posts: 39
Location: Aachen, Germany
Trades: 0
I'm trying to get a list hirachy with very little text indent, but apparently that's more difficult than I thought.

the basic idea is
HTML Code:
<ul class="menu">
<li>a</li>
<ul class="menu">
<li>b</li>
<ul class="menu">
<li>c</li>
</ul>
</ul>
</ul>
I'm using
[CSS]
ul.menu
{
text-indent: -40px;
}
[/CSS]

Now to the problem: I can't knock the menu back too much, because it will disappear. Furthermore, I want to decrease the next level's indent to a reasonable amount. Right now I have enough indent to fit another menu in that space, but of course I'd like it with an indent of 5px or 10px to the upper level.

I'm pretty sure that there is an option for this, though I couldn't find it so far.
Recrehal is offline
Reply With Quote
View Public Profile Visit Recrehal's homepage!
 
 
Register now for full access!
Old 04-29-2005, 10:52 AM
Recrehal's Avatar
Experienced Talker

Posts: 39
Location: Aachen, Germany
Trades: 0
Wow this forum is ridiculously slow O_o

So there are two parameters that are interesting for lists: text-indent and margin

text-indent is pretty self explanairy, it knocks your text back or forth depending on the assigned value.

margin defines the actual indent of the list. If you set the margin to 5px the list hirachy will indent the text exactly 5px per level.

so to get a list with 10px indent simply use
[CSS]
ul
{
margin: 10px;
text-indent: -10px;
}
[/CSS]

The text-indent will move the first level back to normal positioning which might be desired in a menu. If you're okay with an initial indent of 10px you can of course skip that parameter; however, if you don't it will only effect the list as a whole.
Recrehal is offline
Reply With Quote
View Public Profile Visit Recrehal's homepage!
 
Reply     « Reply to CSS: lists text indent
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10438 seconds with 12 queries