Dear CSS Gods
- Started
- Last post
- 7 Responses
- Atkinson
Please tell me: www.caferoyal.org, nav on the left of the page, categories followed by stock count. How do I get the stock count on the same line as the category - above the 4px border? Here's my code:
<div id="navigation">
<ul>
<li><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages('title_li='); ?>
<?php wp_list_categories('show_count=1&alphabetical=1&title_li='); ?>
</ul>
</div>
- Drno0
where's your css?
- Atkinson0
haha yes sorry,
#navigation {
width: 190px;
margin-bottom: 15px;
}
#navigation ul {
list-style-type: none;
margin: 0px;
padding: 0px;
}
#navigation ul li {
list-style-type: none;
margin-bottom: 2px;
margin: 0px;
padding: 0px;
}
#navigation ul li a {
display: block;
color: #333;
padding-right: 2px;
padding-left: 2px;
padding-top: 2px;
padding-bottom: 2px;
font-size: 12px;
border-bottom: 4px solid #f2f2f2;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
#navigation ul li a:hover {
border-bottom: 4px solid #7998a1;
color: #111;
}
- maximillion_0
can you put the numbers inside the a tag?
- leadtrum0
#navigation ul {
float: left;
width: ;
}
#navigation ul li {
float: left;
width: ;
}
#navigation ul li a {
float: left;
width: 75%;
}
#navigation ul li span {
float: right;
width: 25%;
}<div id="navigation">
<ul>
<li><a href="#">Prints</a><span>(12)</span></li>
</ul>
</div>This all depends on if you want the entire block to be clickable or not.
- maximillion_0
i moved these properties from #navigation il li a:hover
to
#navigation ul liproperties:
display:block;
border-bottom: 4px solid #f2f2f2;
- Atkinson0
Hm, I'm still trying to get my head around css / php etc so forgive my non-scientific explanation! The numbers are php and automatic dependent upon the number of items in that category, so they'll go up and down as I add / sell items. I just want, for example, books (12), to be a link as 'home, about and catalogue are, with the border beneath, rather that the border between books and (12)
- maximillion_0
is this wordpress?
which i think it is, if that the case youll need to find which methods output in the format you need. from the code you show about it looks as though
wp_list_pages('title_li=');
wp_list_categories('show_count=1...output html with tags. one of them is oputputting the tags and the other isnt and this is causing your problem. try and find a method that will output the name and number of categories on one "a" tag. or.... edit yr css as per the above