Jump to content

Why didn't position:sticky work?


eaglehopes
Go to solution Solved by kicken,

Recommended Posts

In my website I am trying to use position:stick for a table row (<tr> element). But it did not work, I read possible causes but none of them is valid for me. 

My website is my web page and problematic table row is 

 

<tr class="StickyMenuBar" id="MainMenuBar">
          <!--  MENU ROW -->
    
        <td class="MenuTag" id="menuBar">

...

and corresponding css code is :

.StickyMenuBar {
 position: -webkit-sticky;
 position : sticky;
 top : 0px;
}

Thanks.

Edited by eaglehopes
add tags
Link to comment
Share on other sites

2 hours ago, eaglehopes said:

Its behavior is browser dependent then.

This can be a frequent issue, which is why it's important to test on multiple browser.  You can also reference caniuse.com to get an idea of what is supported on which browser versions.  If you look up position: sticky there for example, it says for chrome (up to 90, which is your version) it's partially supported with the note:

Quote

Supported on th elements, but not thead or tr

Modern chrome fully supports it.

Edited by kicken
  • Great Answer 1
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.