www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] CSS selection problem

  1. #1
    Join Date
    Mar 2004
    Location
    Nevada, USA
    Posts
    185

    resolved [RESOLVED] CSS selection problem

    I am trying to add a padding to the top and bottom of the content in the div shown on the following code that is the drop-down menu for the "story" button.

    The code shown is taken from the inspector.
    Code:
    <body>
    
        <div id="page">
            <nav role="navigation">
                <ul>
                    <li></li>
                    <li>
                        <a href="../story/index.shtml"></a>
                        <div>
                            <a href="#"></a>
                            <a href="#"></a>
                            <a href="#"></a>
                            <a href="#"></a>
                            <a href="#"></a>
                            <a href="#"></a>
                        </div>
                    </li>
    ------------------------
    I have a file called nav.css in which I have the following code. I tried adding the padding here, but this doesn't work.

    Code:
    li:hover div {
      display: block;
      z-index: 100;
    }
    I seem to have a mental block on this one. Can anyone help?
    Last edited by lkeeney; 08-27-2014 at 07:05 PM.
    Larry

  2. #2
    Join Date
    Nov 2002
    Location
    Flint, Michigan, USA
    Posts
    593
    I added the padding as shown and it works the way I think it should. What do you see?

    Code:
    li:hover div {
      display: block;
      z-index: 100;
    padding: 100px;
    }


    http://www.gofundme.com/bkzr98
    Please give me a hand at http://www.gofundme.com/bkzr98.

  3. #3
    Join Date
    Mar 2004
    Location
    Nevada, USA
    Posts
    185
    Thank you very much. I just resolved the problem myself, and here is what worked for me:

    Code:
    ul li div a{
        padding-top: 7px;
        padding-bottom: 7px;
    }
    I tried every combination I thought would work, but most of them effected other content on the page.

    I would like to be able to show you the website page, but on this website both my wife and I had to sign a non-disclosure agreement because this is a new and unusual business, and my client is very concerned about letting anyone see the site and getting a jump on their idea.
    Last edited by lkeeney; 08-27-2014 at 08:47 PM.
    Larry

  4. #4
    Join Date
    Nov 2002
    Location
    Flint, Michigan, USA
    Posts
    593
    I expect that the code around the snippet that you posted made the simple solution that I posted non-working. Your much more specific code had higher specificity, so it worked for you.
    Please give me a hand at http://www.gofundme.com/bkzr98.

  5. #5
    Join Date
    Mar 2004
    Location
    Nevada, USA
    Posts
    185
    My problem before was, I was leaving out the "div" in the selector.
    Larry

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles