Topic: Buttons larger than viewport

Leitner free asked 6 years ago


Hello,

I have a problem with buttons and offset in a container-fluid. My buttons are larger than the viewport. See here: https://mdbootstrap.com/snippets/jquery/leitner/181295

When I try this code without MDB (plain Bootstrap only) it works. See: https://www.bootply.com/JrstzpU73r

Thanks for your help :)


Marta Wierzbicka staff answered 6 years ago


Hi,

try code from here: https://mdbootstrap.com/snippets/jquery/marta-szymanska/183646. The problem is that ".btn.btn-block" class has settings "margin: inherit" and when you add the ".offset-2" class to the ".col-5" class, a button take this margin so you have something like two margins. To stop this behavior, I've added the ".m-0" class to the button which has the ".offset-2" wrapper.

Best,

Marta


Leitner free commented 6 years ago

Thanks Marta, it works :)

Regards Christian


Marta Wierzbicka staff answered 6 years ago


Hi,

You're welcome.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.10
  • Device: PC, Android
  • Browser: Chrome, Edge
  • OS: Windows 10, Android 8
  • Provided sample code: No
  • Provided link: Yes