Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change css in a Bootbox window

How can I add styling (let's say bold attribute) to the "Hello world" in this code:

bootbox.alert("Hello world!", function() {
   Example.show("Hello world callback");
});

Thank you

like image 404
kambi Avatar asked Mar 06 '13 11:03

kambi


Video Answer


1 Answers

Expanding on James King's answer:

using firebug's console you can see that the response to the command:

bootbox.alert('hello world')

is a reference to the bootbox containing div element; Object[div.bootbox]

So it's very easy to totally redefine the alert when you call it by simply changing its css attributes:

bootbox.alert('Danger!!' ).find('.modal-content').css({'background-color': '#f99', 'font-weight' : 'bold', color: '#F00', 'font-size': '2em', 'font-weight' : 'bold'} );
like image 152
Mark B Avatar answered Oct 19 '22 19:10

Mark B