Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

101
Views
Overflow-x: hidden position disables position: sticky of my container

I have an element that is supposed to be sticky when scrolling. How can I have this element sticky, and horizontal scroll on mobile hidden? What am I doing wrong and having horizontal scroll on iPhone in the first place?

Thanks.

.sticky-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 12%;
}

.sticky-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 12%;
}
<div class="container">
  <div class="row">
    <div class="col-md-6 align-self-start sticky-sidebar">
      <h2 class="text-light landing-heading d-inline">What we do</h2>
      <img src="https://via.placeholder.com/100" alt="image" />
      <p>This is sticky!</p>
    </div>

9 months ago · Santiago Trujillo
1 answers
Answer question

0

One of my elements had the bad padding. Fixed the padding, and horizontal scroll disappeared. I deleted overflow-x because now I don't need at everything worked like a charm.

9 months ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.