Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Update added padding to <main> element when using sidenavbar

waynefulcher pro asked 4 years ago


I recently updated to the latest MBD code and now I see that when my browser window is wide enough for the side nav bar to show something in the code is now adding "padding-left: 240px;" to the styles of the element. This is now messing up the alignment of everything but I cant figure out how to override that in the js.

Thanks Wayne


Krzysztof Wilk staff answered 4 years ago


Hi!

There are two ways to overwrite it.

CSS: You can just add selector-of-an-element { padding-left: 0 !important }

JS: If you want to do it by JS you can use .css() jQuery method. Sample code should look like this: $('selector-of-an-element').css('padding-left', '0')

Of course, you have to swap selector-of-an-element with .class / #id of an element you want to use.

It's hard to help without a working example, so if solutions above didn't help, could you make a snippet with your problem in our online MDB Editor here - https://mdbootstrap.com/snippets/ then paste it below? It'll be very helpful :)

Best regards



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: pc
  • Browser: CHROME
  • OS: WINDOWS 10
  • Provided sample code: No
  • Provided link: No
Tags