Jump to content

Why didn't position:sticky work?


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
https://forums.phpfreaks.com/topic/315277-why-didnt-positionsticky-work/
Share on other sites

I am using Chrome 90.0.4430.212 and not working for me. But, after your reply, I used Firefox 98 and it worked ! Its behavior is browser dependent then. 

Also I read the link you have sent, it contains lots of valuable info for me. I will try to change my design. Thanks kicken.

 

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
15 hours ago, kicken said:

You can also reference caniuse.com to get an idea of what is supported on which browser versions. 

@kicken, the caniuse.com is a fantastic website ! I saved it to my bookmarks immediately! I couldn't imagine of the presence of such a great & supporting website until one mention about it.

 

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.