Цей вебсайт матиме обмежену функціональність, доки ми проводимо його обслуговування для поліпшення роботи. Якщо прочитана стаття не розв'язала вашу проблему і ви хочете поставити питання, наша спільнота підтримки з радістю допоможе вам на @FirefoxSupport у Twitter та /r/firefox на Reddit.

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше

CSS position: sticky fails on a long parent

  • 4 відповіді
  • 0 мають цю проблему
  • Остання відповідь від Chrispink

more options

MacOS 14.6.1 Firefox 31.0.3 (aarch64)

I have a long (19000px) table with a sticky row at the top. On Safari or Chrome it works fine. On Firefox it works for around 800 px and then becomes 'unsticky'.

Is this a known behaviour?

MacOS 14.6.1 Firefox 31.0.3 (aarch64) I have a long (19000px) table with a sticky row at the top. On Safari or Chrome it works fine. On Firefox it works for around 800 px and then becomes 'unsticky'. Is this a known behaviour?

Обране рішення

I did pick up one thing from your codepen which has resolved the issue. It's a question of the semantic markup. If I wrap the header rows in <thead> then the sticky behaves correctly. (although removing this doesn't break the codepen). I'm happy with that as correct semantics is never a bad thing ;-)

Thanks again

Читати цю відповідь у контексті 👍 1

Усі відповіді (4)

more options

I can't edit the original but it looks strongly like it works for one viewport height.

Корисно?

more options

Корисно?

more options

No, this works perfectly (even if I duplicate the rows). Although the structure and CSS are very similar.

So the issue is somewhere else or more complicated.

I will try and duplicate my situation in a codepen. At the moment it's in a private part of a website.

Thank you for the help.

Корисно?

more options

Вибране рішення

I did pick up one thing from your codepen which has resolved the issue. It's a question of the semantic markup. If I wrap the header rows in <thead> then the sticky behaves correctly. (although removing this doesn't break the codepen). I'm happy with that as correct semantics is never a bad thing ;-)

Thanks again

Корисно?

Запитати

Щоб відповідати на повідомлення, ви повинні ввійти у свій обліковий запис. Поставте нове питання, якщо ви ще не маєте облікового запису.