CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 12th, 2003, 08:06 PM
zapata zapata is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 96 zapata User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 19 h 36 m 16 sec
Reputation Power: 5
CSS, Menu using UL (lists), border

Hello all,

I have a menu within a tabel that's made using html lists.

I'm using something like this to draw a litle bellow each element (li) to improve separation from the other elements - I'm not using any bullets.

Code:
border-bottom: 1px solid color


The problem is the following:

If the menu consists of A, B and C it shows:

A
___
B
___
C
___

Where __ is that border-bottom property. But then the table closes and I get a ___ real near the table border which is not great.

I would like to know if there's a way to do this, taking out the border of that last one?

My current fix was to creat a similar class in the .css file where I've put all properties of the except the border-bottom one.

the code is then something like this:

Code:
<ul>
 <li>A</li>
 <li>B</li>
</ul>
<ul>
 <li>C</li>
</ul>


Any other way? Thanks in advance.

Reply With Quote
  #2  
Old December 13th, 2003, 09:06 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,622 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 6 Days 2 h 13 m 2 sec
Reputation Power: 548
Code:
css:
li {
	border-bottom:1px solid #000000;
}

li.last {
	border-bottom:none;
}



html:

<ul>
	<li>punkt</li>
	<li>punkt</li>
	<li class="last">punkt</li>
</ul>


this one way of doing it. by assigning a class to the last li element.

you could also use Adjacent sibling selectors, which works in standard compliant browsers, though then you have to know the number of menu elements.


Code:
css:
li {
	border-bottom:1px solid #000000;
}

li + li + li {
	border-bottom:none;
}


html:
<ul>
	<li>punkt</li>
	<li>punkt</li>
	<li>punkt</li>
</ul>

Last edited by Akh : December 13th, 2003 at 09:08 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS, Menu using UL (lists), border


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway