Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Shadow line items

Posted on 2009-05-13
3
Medium Priority
?
375 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
ID: 24379767
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
ID: 24379926
>>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 1000 total points
ID: 24380121
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

885 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