Search
 
SCRIPT & CODE EXAMPLE
 

CSS

How to prevent anchor links from scrolling behind a sticky header with one line of CSS

// src/scss/navigation.scss

$sticky-breakpoint: 32em;

// 1. Approximate height of sticky navigation.
[id] {
  @media (min-height: $sticky-breakpoint) {
    scroll-margin-top: 100px; // 1
  }
}

.navigation {
  // ...

  @media (min-height: $sticky-breakpoint) {
    position: sticky;
    top: 0;
  }
}
Comment

PREVIOUS NEXT
Code Example
Css :: align ionic icons and text css 
Css :: how to gain full width of a phone website in html and css 
Css :: how to fix stylelint errors 
Css :: css change width animation 
Css :: how to add box shadow to all sides css 
Css :: Maintaining the final state at end of a CSS3 animation 
Css :: css not last of type 
Css :: css table column spacing 
Css :: how to make image not repeat on background 
Css :: hiding button border when clicked 
Css :: how to center image css 
Css :: read only easyui 
Css :: css shaddow 
Css :: how to serve css in golang 
Css :: restrict flex items in a row 
Css :: css rules only for mozilla 
Css :: change color of mark tag in html 
Css :: css element same line 
Css :: how to write firefo specific css 
Css :: css invert text color 
Css :: label width css 
Css :: remove hover css on a text 
Css :: update arch linux 
Css :: css3, media queries cheatSheet 
Css :: top left right bottom css shorthand 
Css :: To make card box appear more bigger when hover 
Css :: macbook change screenshot to jpg 
Css :: word spacing css 
Css :: line in middle word css 
Css :: td wrap text without space 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =