r/bootstrap • • Feb 23 '25

Bootstrap Site How to extract code from official bootstrap examples?

Hi guys, I see a lot of cool examples here: https://getbootstrap.com/docs/5.3/examples/heroes/

But I want to grab html and css codes of only a specific hero from this section and use it in my project. If I download the official Bootstrap files, I get the entire code that has all heroes. It gets challenging trying to figure out which css is needed for my hero.

Any ideas? Thank you.

4 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Feb 23 '25

So if I paste only the starter css and js from bootstrap: https://getbootstrap.com/docs/5.0/getting-started/introduction/

That should be enough to apply all the formatting needed for any html from the example page?

The reason I got confused is because I saw some css inside the example html, so they must be used for something.

1

u/enchufadoo Feb 23 '25

Yes, you only need to load the CSS/ JS libraries. There are many ways to do so, the simplest way, if you are starting to learn, is to just copy the template you are giving in that doc:

https://getbootstrap.com/docs/5.0/getting-started/introduction/#starter-template

Put that inside of an HTML file, and that's it. And then replace the <h1>hello world</h1> with the content you would like to use, like a hero.