top nav bar blocking top content of the page
Add to your CSS:
body {
padding-top: 65px;
}
From the Bootstrap docs:
The fixed navbar will overlay your other content, unless you add padding to the top of the body.
Bootstrap fixed navbar blocking content link to on the page
Found the answer:
Instead of sticky-top, I used fixed-top, then added
body {
padding-top: 70px
}
to the CSS and
window.addEventListener("hashchange", function() { scrollBy(0, -70) })
to the script.
See here: https://jsfiddle.net/ao3b0m95/
Edit: I don't think I need the CSS, just the JS will do the job.
Bootstrap 4 Nav Bar fixed-top over content
I fixed this so now the content will always start after the fixed nav bar.
I added the below to the body css
min-height: 51.5rem;
padding-top: 2.5rem;
Thank you @ZimSystem for pointing me in the right direction.
Bootstrap top navbar blocking my content laravel
Try adding the "padding-top: 60px;" style to whatever element is wrapping the "@yield('content')" area rather than to the body element. Hopefully, that will push your content below the absolute-positioned navigation bar.
Navbar covering content when I click on a link to navigate to different sections of the page
Since the browser is doing what it is told to do properly (scrolling to the anchor's position), you have to do a little "hack" to get something like this to work. Here's the basic idea:
- Create a container element for both a title and an (unseen) anchor
- Create an element for the title, and put it in the container
- Create an element for the anchor, and put it in the container
- Use absolute positioning to move the anchor the appropriate amount up (generally something like FIXED_HEADER_HEIGHT + EXTRA_PADDING)
Here's a quick example:
.container {
position: relative;
}
.anchor {
position: absolute;
top: -65px; /* given the fixed header is 50px tall, and you want 15px padding */
left: 0px;
}
And the HTML:
<div class="container">
<h2 class="title">Section Title</h2>
<a class="anchor" name="target"></a>
</div>
Then, any link to #target
will go to a location 65px above .title
.
Why my nav-bar hides my texts in a fixed position?
It happens because fixed property remove element from main flow. You can use margin-top property for citations div.
Related Topics
Passing Parameters to CSS Animation
Css Text-Transform Capitalize on All Caps
Top Nav Bar Blocking Top Content of the Page
Using Variables in Property Names in Less (Dynamic Properties/Property Name Interpolation)
Expand Div from the Middle Instead of Just Top and Left Using CSS
Enable :Focus Only on Keyboard Use (Or Tab Press)
<Input> Doesn't Inherit the Font from <Body>
Sub-Pixels Calculated and Rendered Differently Among Browsers
How to Change Btn Color in Bootstrap
Simulating Transform-Origin Using Translate
Vertical-Align Aligns Everything Else Except Self
Do I Need to Wrap Quotes Around Font Family Names in Css
Difference Between Background and Background-Color
Double Border with Different Color
Image Greyscale with CSS & Re-Color on Mouse-Over
How to Keep Wrapped Flex-Items the Same Width as the Elements on the Previous Row