Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase font size in javascript alert()

Tags:

javascript

Can I control the font size of the string in a javascript alert() call??!

I've the image below and I want to increase the font size so that it is legible.

Javascript Alert Pop Up

like image 931
ptamzz Avatar asked Jun 28 '11 14:06

ptamzz


People also ask

How do I increase the size of my alert box?

To set the width and height of an alert box in JavaScript, you need to use the custom alert box. This alert box is styled with CSS.

Can I style JavaScript alert?

The standard alert box in JavaScript does not provide the option to apply CSS. To style your alert box, you need to create a custom one first. The custom alert box will be created using jQuery and styles will be applied to CSS.

Can I customize the alert in JavaScript?

The finally negative to these native JavaScript alert dialogs is they cannot be styled or customized.


2 Answers

Can I control the font size of the string in a javascript alert() call??!

Nope. How the alert window is rendered is entirely up to the browser.

You would have to use a JavaScript based dialog windows alternative like jQuery UI Dialog.

like image 97
Pekka Avatar answered Oct 13 '22 00:10

Pekka


No, this is controlled by the browser. I don't use alerts anymore I use jQuery UI dialog, it's fully customizable

like image 34
Raoul Avatar answered Oct 12 '22 23:10

Raoul