I tried to find resources about 'alert' element, but nothing came out.
<alert type="success">Your message</alert>
But I can use it without issue. How can I apply CSS styles to different alert's type?
I tried to find resources about 'alert' element, but nothing came out.
<alert type="success">Your message</alert>
But I can use it without issue. How can I apply CSS styles to different alert's type?
You look like you are trying to use Bootstrap's 'alert' classes (e.g. 'success'). http://getbootstrap.com/components/#alerts
The only way to make that a semantic element like <alert />
that I know of is something like AngularJS: http://angular-ui.github.io/bootstrap/#/alert
In this case, it is all styled by Bootstrap, or whatever Bootstrap theme you are using.
First there is not an HTML tag alert. you can create an alert with javascript.
You cannot add style to an alert as it is produced by the browser by default.
Have a look to this post: How do I style the alert box with CSS?
W3C is always a very credible source for HTML syntax.
http://www.w3.org/TR/html-markup/Overview.html#toc
Now for where you heard about an <alert>
element I have no idea. Never heard of it, but that does not mean it does not exist. W3C does not have it in this "complete set of HTML elements". It may be an element something other than HTML
As far as I know, and as some others have pointed out, there is no alert element in HTML.
However, you can use it. To allow for the HTML evolution, any modern browser will accept happily any unkown element.
I am not saying it is a good practice to use whatever name you want for an element. I am saying that the browsers will accept it.
About giving it format, use standard practices. Give it a class, or an id, and reference that in the CSS. No problem .
Technically there is a tag but its for html5 and its not completly supported,There is a table at the end of this article that shows browser compatibility.
hope this is informative:
Native Popups and Modals With the HTML5 “dialog” Element