DPC-iT notizBLOG

Rund um IT und Webdesign was ich sonst vergesse

Archive for September, 2017

Anker bei Fixed Navbar treffen nicht

Posted by Daniel Pest under CSS

If you’re using a .navbar-fixed-top fixed to top navbar in Twitter Bootstrap you probably have noticed your anchor ahref links no longer line up correctly.

The easiset way to fix this is to the use the <section id="MyAnchor"> tag with a padding-top equal to the padding you’ve added to the body.

So for example if you have:

.body {
padding-top:40px
}

You will then want to add the same padding to your section CSS:

section {
padding-top:40px;
}

If the 40px gap above each section is going to mess with your design mojo you can add a negative margin-bottom. So for example:

section {
padding-top:40px;
margin-top:-40px;
}

 

Quellenangabe: https://www.servermule.com.au/help/bootstrap-anchors-fixed-nav/

CSS LoVe HAte

Posted by Daniel Pest under CSS

The selectors she is referencing is for anchor elements:

a:link
a:visited
a:hover
a:active

Optimization WordPress Plugins & Solutions by W3 EDGE