Create Button btn-block


Noob here.

Going through the exercises, I read about bootstrap and the generation of a button using

‘<‘button class=“btn btn-block btn-info”’>’ info ‘<’/button’>’

If I were to generate a blank HTML, could I write the above line straight in the HTML page (without the quotations), and would it work?
Or do I need an external file file linked in the HTML to be able to use this function?

I don’t think so. Bootstrap is a separate file containing classes that is referenced when when the classes “btn”, “btn-block”, and “btn-info” are used. That is to say, if Bootstrap isn’t referenced in the beginning of your document (like it is done behind the scenes of the exercises), then the line probably won’t work.

I’m a noob, too, so take this explanation with a grain of salt. :slight_smile:

Thanks, yeah, I figured something like this would be the case.
Why make us do these exercises, when all depends on the code that’s being done behind the scenes?
I’d rather learn how to make the CSS, then apply it!
So at least I would understand.

Just using “btn-default”, “div class=“row””,… etc… is all predefined in the backing files, and won’t work the same in other documents.
Like, I might be coding a page where the btn-info is configured green instead of blue, or doesn’t even exist, and another trigger needs to be used to draw a button on the page…

You make a good point, but most bootstrap CSS is the same, so the content is still pretty relevant. I feel you tho