Jump to content

Anchor activate to active anywhere within enclosed block.


CB150Special

Recommended Posts

This is a styling issue but is there another way to do this ?

 

Here is my code.

<li style="display:inline-block;"><a href='home_page.php'>Home</a></li>

 

This line is in a list with the following CSS

    #list li {
        width: 70px;
        margin: 5px auto;    
        padding: 5px 15px 5px 15px;  
        border-radius: 5px;  
        border-style: solid;
        border-width: 1px;
    }

and the hover

   #list li:hover {
        background:#dbc9a0;
        cursor: pointer;
  }   

The hover works great and any time the cursor moves over the box, I get the change.

 

The problems is that the link only works if I click over the active anchor within the the box and not anywhere else in the box.

 

It does appear that anchors have minds of their own.

Link to comment
Share on other sites

This is a styling issue

...and not a PHP issue. Moved.

 

It does appear that anchors have minds of their own.

Well, yeah. Of course they do.

 

You're applying a padding to the

  • , which means there will be space inside the
  • that is not covered by any child elements - like the . Now, consider what would happen if you were to instead expand the itself.
  • Link to comment
    Share on other sites

    Dude.

    • What you currently have: an automatically sized anchor within a fixed-sized list entry. That gives you a small clickable area in a big box.
    • What you need: a fixed-sized anchor within an automatically sized list entry. That gives you a big clickable box.
    • How to achieve this: Move the CSS rules from the list entry to the anchor.
    Link to comment
    Share on other sites

    This thread is more than a year old. Please don't revive it unless you have something important to add.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.