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
Another problem with CSS List alignment
Old 09-21-2007, 09:19 AM Another problem with CSS List alignment
nickharper's Avatar
Extreme Talker

Latest Blog Post:
Testing this bad boy out!!!!!
Posts: 221
Name: Nick
Location: Coventry, UK
Trades: 1
Hi Guys,

I have another small problem with CSS List alignment.

If you take a look at http://www.goldnbrowncoventry.co.uk/ you will see that on the menu the "Services" and Information are slightly to the left.

These are at li level but with a list below them as follows:

Code:
<li><a href="../index.php">Home</a></li>
    <li>Services
      <ul>
        <li><a href="../cosmetic.php">Cosmetic Injections</a></li>
          <li><a href="../facials.php">Facials</a></li>
        <li><a href="../hairremoval.php">Hair Removal</a></li>
        <li><a href="../skintreatments.php">Skin Treatment</a></li>
        <li><a href="../spraytans.php">Spray Tans</a></li>
        <li><a href="../sunbeds.php">Sunbeds</a></li>
      </ul>
Can anybody help?

Thanks
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

nickharper is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-21-2007, 04:57 PM Re: Another problem with CSS List alignment
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You have way over-complicated your css..wow. You need to learn to use some css shorthand. You also do not need to specify EVERY level, that's what the cascade is all about. In other words, there is no need to do this:

#container #rightbar ul
#rightbar ul will suffice

You also don't need this: #rightbar ul > li > ul , #rightbar ul ul will work the same way.

You had so many conflicting rules in there for your list, I had to rip it all out and start over. This was the result:

Quote:
#rightbar ul {
font: 14px bold Arial, Helvetica, sans-serif;
color: #7F0000;
list-style-type: none;
line-height: 1.5em;
/*border: 1px none #E57200;*/
margin: 0px;
padding: 0px;
background: #e57200;

}
#rightbar ul li {
border-bottom: 1px solid #7a0000;
letter-spacing: 0.5px;
font-weight: lighter;
padding: 0 0 0 3px;
margin: 0;
}

#rightbar ul li a {
font-family: Arial, Helvetica, sans-serif;
color: #7F0000;
list-style-type: none;
text-decoration: none;
line-height: 1.5em;
font-weight: normal;
padding-left: 3px;
}
#rightbar ul li a:hover {
color: #FAD71E;
/*list-style-type: none;*/
text-decoration: underline;
line-height: 1.5em;

}
#rightbar ul ul{
background: #ffb15f;
font-size: 12px;
}

#rightbar ul ul li{
border: none;
}
#rightbar ul ul li a{
padding-left: 10px;
}
#rightbar ul ul li a:hover{
color: #7F0000;
text-decoration: underline;
}
When I say shorthand you can turn this:
padding-top: 0px;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 0px;

into this: padding: 0 5px 0 0;
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-22-2007, 06:14 AM Re: Another problem with CSS List alignment
nickharper's Avatar
Extreme Talker

Latest Blog Post:
Testing this bad boy out!!!!!
Posts: 221
Name: Nick
Location: Coventry, UK
Trades: 1
I see what you mean.

I guess I was doing everything the long away all of the time but I have looked through how you did it and it makes sense

Thankyou very much *again* for your help
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

nickharper is offline
Reply With Quote
View Public Profile
 
Old 09-22-2007, 10:31 AM Re: Another problem with CSS List alignment
Defies a Status

Posts: 1,605
Trades: 0
Don't mean to hijack your thread. I just want to clarify.


Is this a typo?


Quote:
When I say shorthand you can turn this:
padding-top: 0px;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 0px;

into this: padding: 0 5px 0 0;
There are two 5's in the first one and only one in the second one.
What is the order of that top, right,left, bottom?
All browsers respect it?
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 09-22-2007, 11:49 AM Re: Another problem with CSS List alignment
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
oops, yes that's a typo. The statement should read:
padding: 0 5px; or padding: 0 5px 0 5px

Using the first represents top/bottom, left/right
using the 2nd represents top, right, bottom, left

Just remember TRouBLe

And yes, ALL browsers support it.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Another problem with CSS List alignment
 

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.45271 seconds with 12 queries