r/WebdevTutorials • u/SadSenpai420 • Dec 17 '20
Bootstrap is hard (!?)
For someone who knows an average amount of HTML & CSS (and a little bit of JS) I find it kinda hard to integrate bootstrap in my website. Am I the only one facing issues?
I know it's supposed to make my work easier, but when I apply my own CSS properties, it messes up the bootstrap elements & classes, and I find it almost impossible to debug it.
Do you have a hack/special way of dealing with bootstrap? And normal CSS?
11
u/mirana_bot Dec 17 '20 edited Dec 17 '20
I've been using bootstrap for years from v3 to v4. and made 100+ templates with it.
the only advice I can give to you is don't apply your own styles to the bootstrap classes as much as possible especially on the grid system because they have media query styles. for example you don't want to style the .row, .col classes directly like override them with so much styles. just use them as a container of your element.
on components like button, create your own class then override the bootstrap css there.
you can message me the link of your website so I can give you more advice on how to deal with bootstrap.
3
u/huhwhatnowwhat Dec 17 '20
THIS!!!
Do as much as you can with the bootstrap classes (which will be a lot) before writing your own css.
When you write your own, don’t target bootstrap rules. Add your own class.
1
2
1
u/SadSenpai420 Dec 17 '20
Wow, now I see where I was going completely wrong. ̶I ̶f̶r̶e̶q̶u̶e̶n̶t̶l̶y ̶s̶t̶y̶l̶e̶d ̶m̶y ̶r̶o̶̶w ̶a̶n̶d ̶c̶o̶n̶t̶a̶i̶n̶e̶r ̶c̶l̶a̶s̶s̶e̶̶s
I'll keep this note in mind always! As of now, I haven't made a website but when I do, I'll surely message you for your inputs :D
2
8
u/spacenotsodandy Dec 17 '20
I'm sorry I do not have any special hacks for you, but I just wanted to say no. You definitely are not the only person with this issue.
I created a site using HTML and CSS over a year ago, I am now trying to implement some changes, and now working as part of a team who have a strong preference for Bootstrap. I tried to keep up but I don't really get how it works and eventually I just said "If you guys really want to use Bootstrap so badly you'll have to go it alone until I've done some more research". Thanks for creating this thread.
5
u/SadSenpai420 Dec 17 '20
You did the right thing :) learning it properly and then doing it is better than getting all stressed up about it Glad to know I'm not the only one :')
5
u/perrugia Dec 17 '20
I had a similar issue except I was the new team member and I just couldn’t get it. Eventually I was able to convince my team lead to get away from it. Maybe someone with better experience can give me insight on the matter.
4
u/BonSim Dec 17 '20
No you're not. I knew how to create a basic layout using css before I learned bootstrap. And for me making layouts with bootstrap is a nightmare. What scares me more is having to work on a already existing site bootstrap.
3
2
u/agitatedhoneybadger Dec 17 '20
Could you give an example of what you are trying to do or a codepen? It would make it easier to help.
1
u/SadSenpai420 Dec 17 '20
I started off with lots of basic html & css (hence I have a lot of sub divided files, making it hard to bring it together on codepen)
But basically, I was trying to add carousel before my footer and it just wouldn't work for the love of God
I did temper with a lot of styles for the container classes, so that's possibly the issue
1
u/agitatedhoneybadger Dec 17 '20 edited Dec 17 '20
I can guarantee that changing the styles or, specifically, the class names will cause issues.
So, I don't know how it is broken but, I can try to help with that. I made a codepen so you can see it working.
https://codepen.io/adamfarver/pen/wvzdVro
Hope it helps. I don't know whether it was not scrolling or what is happening. But take a look.
Edit: you can overwrite class appearance properties but that’s it. Hopefully, that clears some things up.
2
u/jmhitokiri Dec 17 '20
For me it's the other way around, I can integrate bootstrap easily but I find it hard to do anything look good using only css. Maybe you could try crating your layout using only bootstrap classes and from there customize according to your needs.
1
u/SadSenpai420 Dec 17 '20
Ah yes! That makes sense Adding bootstrap after css was a pain, I definitely see how your way of things makes it better
2
u/OhBabyChaChaCha Dec 17 '20
Try mobirise found at mobirise.com. See if that might be something that would help you.
2
u/justanotherhomebody Dec 17 '20
My way of dealing with bootstrap is to use uikit instead and build a custom theme 🙃
1
u/not_a_gumby Dec 17 '20
One of the reasons I use Bulma over Bootstrap. Overall, less bloat, you can write all your own JS for widgets, and you can compile the CSS with SASS preprocessor so you import only what you need and can write your own custom CSS which I find rarely if ever clashes with the Bulma CSS as long as I'm selecting elements correctly and specifically. Otherwise, Bulma also allows you to modify some of the styling on their classes as you wish by changing variables, there's a whole thing in the documentation about it.
But yeah, I've only used Bootstrap once and I'm solidly convinced Bulma is better in every regard.
16
u/MancusoMusic Dec 17 '20
Wait until you find out about React ;)
When I have trouble wrapping my head around a programming concept, I find that learning the same material from a few different sources can be helpful. If you're learning Bootstrap from a book, consider watching some Youtube videos on it instead, or finding a few other books. Sometimes, just hearing the same concept described in a different way can make things 'click' for you.
Good luck, and keep trying! It will get easier.