Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style new Chrome's alert window

Is it possible to style the new Chrome alert boxes, added in version 29?

Run this javaScript in Chrome's console:

alert("This is new")

enter image description here

I ask this because the new window actually looks more like a dialog.

It also displays a tooltip with the coordinates while being dragged.

http://i.snag.gy/xLIu0.jpg

like image 318
XCS Avatar asked Aug 23 '13 15:08

XCS


People also ask

Can you style window alert?

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.

How do I change the style of alert box in CSS?

We will assign a class to the alert box, after that, we design that specific class in CSS. In this example, the class is a container. To design the button we will use the button tag in the CSS to design it. And the appeared messages also can be decorated like we attach a class and can design that too.

Can you customize alert JavaScript?

You can create a custom function that'll replace the native alert() box in the user's web browser. You'll do this from the window object, and the custom function will work as such: Set constants for the alert title and alert button text.


1 Answers

No, you cannot style dialog boxes (including the newly designed one). Use a JS/HTML modal if you need to style a popup instead.

like image 132
ryan Avatar answered Oct 06 '22 00:10

ryan