Bootstrap align navbar items to the right

Bootstrap 5 (update 2021) In Bootstrap 5 (see this question), ml-auto has been replaced with ms-auto to represent start instead of left. Since the Navbar is still based on flexbox, auto margins OR flexbox utility classes are still used to align Navbar content. For example, use me-auto… <nav class=”navbar navbar-expand-lg navbar-light bg-light”> <div class=”container-fluid”> <a … Read more

Disable LESS-CSS Overwriting calc() [duplicate]

Using an escaped string (a.k.a. escaped value): width: ~”calc(100% – 200px)”; Also, in case you need to mix Less math with escaped strings: width: calc(~”100% – 15rem +” (10px+5px) ~”+ 2em”); Compiles to: width: calc(100% – 15rem + 15px + 2em); This works as Less concatenates values (the escaped strings and math result) with a … Read more

What does !important mean in CSS?

It means, essentially, what it says; that ‘this is important, ignore subsequent rules, and any usual specificity issues, apply this rule!’ In normal use a rule defined in an external stylesheet is overruled by a style defined in the head of the document, which, in turn, is overruled by an in-line style within the element … Read more

Vertical Align Center in Bootstrap 4 [duplicate]

Important! Vertical center is relative to the height of the parent If the parent of the element you’re trying to center has no defined height, none of the vertical centering solutions will work! Now, onto vertical centering… Bootstrap 5 (Updated 2021) Bootstrap 5 is still flexbox based so vertical centering works the same way as … Read more

Offset a background image from the right using CSS

I found this CSS3 feature helpful: /* to position the element 10px from the right */ background-position: right 10px top; As far as I know this is not supported in IE8. In latest Chrome/Firefox it works fine. See Can I use for details on the supported browsers. Used source: http://tanalin.com/en/blog/2011/09/css3-background-position/ Update: This feature is now … Read more

Dynamically change color to lighter or darker by percentage CSS

You can do this with CSS filters in all modern browsers (see the caniuse compatibility table). .button { color: #ff0000; } /* note: 100% is baseline so 85% is slightly darker, 20% would be significantly darker */ .button:hover { filter: brightness(85%); } <button class=”button”>Foo lorem ipsum</button> Here’s more reading from CSS Tricks about the various … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)