Solved

Shadow line items

Posted on 2009-05-13
3
366 Views
Last Modified: 2012-08-14
I have a basic menu consisting of line items in a ul.  The items appear as colored boxes.

I'd like to put some sort of shadow under these, and wonder how that should best be done using css [preferably]?

Thanks
0
Comment
Question by:peetm
  • 2
3 Comments
 
LVL 12

Expert Comment

by:Tony van Schaik
Comment Utility
In CSS it's only possible to add a shadow with Filter, but that only works in IE because it uses DirectX http://msdn.microsoft.com/en-us/library/ms533086(VS.85).aspx.
You can do it with Javascript for example with jQuery: http://eyebulb.com/dropshadow/
I suggest making an images and put that in your CSS and make a div for example exactly under the menu with the shadow background image. But i use images in CSS (PNG or GIF) for this kind of things.
 
0
 
LVL 10

Author Comment

by:peetm
Comment Utility
>>I suggest making an images and put that in your CSS

So, I add an image to li here?

#navigation ul {
    list-style-type: none;
    width: auto;
    margin: 0;
    padding: 0;
}
#navigation li {
    font-weight:bold;
    float: left;
    width: 70px;
}

Would I basically make an image 70px wide, or would I/could I have that stretch as I wanted?

And then what would I do in the HTML please?


<div id="navigation" align="center" style="width: 701px">
        <ul>
            <li><a href="home.htm">Home</a></li>
            <li><a href="about/about.htm">About</a></li>
            <li><a href="news/news.htm">News</a></li>
            <li><a href="photo_gallery/photo_gallery.htm">Gallery</a></li>
            <li><a href="information_links/information_links.htm">Links</a></li>
            <li><a href="faq/faq.htm">FAQ</a></li>
            <li><a href="contact/contact.htm">Contact</a></li>
            <li><a href="produce/oil_wine.htm">Produce</a></li>
            <li><a href="getting_here/getting_here.htm">Where</a></li>
            <li><a href="customer/customer_quotes.htm">Quotes</a></li>
        </ul>
    </div>

Many thanks!
0
 
LVL 12

Accepted Solution

by:
Tony van Schaik earned 250 total points
Comment Utility
You can set it in the #navigation div for example a repeating 1 x 10px shadow with repeat-y.
You can also set it on the #navigation ul or if you want it below the li a:href you should put it on the #navigation li a
But if you only want a dropshadow below the whole menu i would do it with an extra div.
I can make an example, just give me the HTML and CSS/images of your menu. So that i can see how it looks like.

      <ul>

           <li><a href="home.htm">Home</a></li>

           <li><a href="about/about.htm">About</a></li>

           <li><a href="news/news.htm">News</a></li>

           <li><a href="photo_gallery/photo_gallery.htm">Gallery</a></li>

           <li><a href="information_links/information_links.htm">Links</a></li>

           <li><a href="faq/faq.htm">FAQ</a></li>

           <li><a href="contact/contact.htm">Contact</a></li>

           <li><a href="produce/oil_wine.htm">Produce</a></li>

           <li><a href="getting_here/getting_here.htm">Where</a></li>

           <li><a href="customer/customer_quotes.htm">Quotes</a></li>

       </ul>

<div class="shadow-line"></div>

   </div>

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now