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

    Maybe I'm blind but can you show me where exactly where requinix showed me how to make it work?  All I see is a discussion.

     

    I already have display:block, if you read the question, I believe the issue is with padding and I can't see anyway around it

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • 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.