/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] indent sub list in navigation

I created a navigation from css that has sub menus.

[url]http://nucitytech.com/test/[/url]

The problem I’m having is that when I click on one of the main links called Group# that shows the sub menu the sub list are the same size as the main links. I want to style the sub list that have a class name of “show” indented from the main list and smaller font. I was able to get a smaller from but not the indent. Any ideas, thanks

[code]
body {font-family: Verdana, Arial, Helvetica, sans-serif;}

h1 {font-size: 24px;}
.cat
{
font-size: 14px;
margin: .2em 0;
color: #0d2474;
font-weight: bold;
text-align: left;
}

.nav {font-size: 12px; font-weight:bold;}
a:link, a:visited, a img {text-decoration: none; border: none;}
ul {list-style:none; margin: 0 0;}

.nav li a:hover {color: red;}
.nav li a
{
height: 2em;
line-height: 2em;
width: 10em;
display: block;
border: 0.1em solid #dcdce9;
color: #0d2474;
text-align: center;
}

.show {display:inline; margin: 0 0; padding: 0 0;}
.hide {display:none;}
[/code]

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscMar 14.2008 — I got this to work in Firefox...I never checked IE

<i>
</i>.show { position: relative; margin-left: 10px; padding: 0 0;}
Copy linkTweet thisAlerts:
@cedtech31authorMar 14.2008 — Thanks that worked. I have another issue I'm trying to make the list heading "list one" the same size as the main navigation links which is 10em.

When I look at it in IE the <li class="cat"></li> that is the heading span the whole length of the <TD> element that's it's enclosed in. I tried putting width: 10em; in the class cat but that didn't work. I'm a little lost as to why that is not working and what is controling it's width. Any ideas would be helpful.

Thanks

new code

<i>
</i>h1 {font-size: 24px;}
.cat
{
font-size: 14px;
margin: .2em 0;
color: #FFFFFF;
font-weight: bold;
background-color: blue;
}

.nav {font-size: 12px; font-weight:bold;}
a:link, a:visited, a img {text-decoration: none; border: none;}
ul {list-style:none; margin: 0 0;}


.nav li a:hover {color: red;}
.nav li a
{
height: 2em;
line-height: 2em;
width: 10em;
display: block;
border: 0.1em solid #dcdce9;
color: #0d2474;
}

.show { position: relative; margin-left: 10px; padding: 0 0;}
.show li a{text-align: left; border: none;}
.hide {display:none;}
.group {text-align: left;}
Copy linkTweet thisAlerts:
@aj_nscMar 14.2008 — em is a relative unit

Hopefully that page that I very quickly googled will help you solve your problem.
Copy linkTweet thisAlerts:
@aj_nscMar 14.2008 — Geez, I have no idea how that link got posted wrong. here's the correct one

em is a relative unit
×

Success!

Help @cedtech31 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...