Title: Offset value defined by class not working
Last modified: January 13, 2024

---

# Offset value defined by class not working

 *  Resolved [WebDocopy](https://wordpress.org/support/users/webdocopy/)
 * (@webdocopy)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-value-defined-by-class-not-working/)
 * Hi.
 * I have issue with setting offset in plugin PSTI. If I set class of header in 
   offset value, it doesn’t work. It seems that the height of header is ignored.
   Only works if I set fixed value in pixels.
 * Can you please help me with this issue.
 * Thank you.
 * BR
 * Tomas
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Foffset-value-defined-by-class-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-value-defined-by-class-not-working/#post-17341485)
 * Hello,
 * I just tested your page and the `.header` offset value seems to be working as
   expected. Did you fix it or?
 *  Thread Starter [WebDocopy](https://wordpress.org/support/users/webdocopy/)
 * (@webdocopy)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-value-defined-by-class-not-working/#post-17345230)
 * Hi.
 * Unfortunately it works only once. When you click on another menu item, the offset
   is gone.
 * I think that the issue could be caused by sticky header settings. I am using 
   fixed position together with top with minus value and transformY to create slide
   up animation. Here is the sticky header class and header class settings:
 * /*Sticky Header */
 * .sticky-header {
 *   background-color: color(3);
 *   position: fixed;
 *   top: -6.25rem;
 *   left: 0;
 *   width: 100%;
 *   transform: translateY(6.25rem);
 *   transition: transform .5s;
 *   box-shadow: 0px 4px 10px rgba(34,36,43,0.1);
 * /*Header*/
 * .header {
 *     width: 100%;
 *     height: 6.25rem;
 *     position: absolute;
 *     z-index: 10;
 *     top: 0px;
 *     left: 0px;
 * I guess that transform of sticky header could cause the problem.
 * What do you think?
 * BR
 * Tomas
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-value-defined-by-class-not-working/#post-17345856)
 * Ah! I see. You are correct, indeed the _translateY_ transformation causes the
   issue.
 * You can achieve the same effect you’re having now by using the margin-top property(
   instead of _translateY_) and the offset will work as expected. Add the following
   to your CSS, test it and let me know:
 *     ```wp-block-code
       header.header.sticky-header {
           transform: translateY(0); 
           margin-top: 6.25rem;
           transition: margin-top .5s;
       }
       ```
   
 *  Thread Starter [WebDocopy](https://wordpress.org/support/users/webdocopy/)
 * (@webdocopy)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-value-defined-by-class-not-working/#post-17346644)
 * Hi.
 * Thank you very much. It works like magic.
 * One small change can make big difference.
 * Tomas
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-value-defined-by-class-not-working/#post-17347992)
 * Glad I helped 🙂 Let me know if you need more help.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Offset value defined by class not working’ is closed to new replies.

 * ![](https://ps.w.org/page-scroll-to-id/assets/icon-256x256.png?rev=1401043)
 * [Page scroll to id](https://wordpress.org/plugins/page-scroll-to-id/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/page-scroll-to-id/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/page-scroll-to-id/)
 * [Active Topics](https://wordpress.org/support/plugin/page-scroll-to-id/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/page-scroll-to-id/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/page-scroll-to-id/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [malihu](https://wordpress.org/support/users/malihu/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/offset-value-defined-by-class-not-working/#post-17347992)
 * Status: resolved