5 exciting new HTML and CSS features to look forward to in 2018
jeudi 18 janvier 2018 à 11:29Les nouveautés du HTML 5.2...
Native Dialog element
Un élément pour faire des dialogbox facilement
<dialog>
<h2>Your title</h2>
<p>Your content...</p>
</dialog>
modal.addEventListener('click', (event) => {
if (event.target === modal) {
modal.close('cancelled');
}
});
modal.close('Accepted');
console.log(modal.returnValue); // logs `Accepted`
CSS scroll snap points
Des points d'arrêts lors d'un défilement
CSS Variables
On connaissait déjà, mais bon, c'est chouette quand même \o/
Support queries
Créer des règles css en fonction de leur support sur le navigateur
@supports (mix-blend-mode: overlay) {
.example {
mix-blend-mode: overlay;
}
}
@supports not(mix-blend-mode: overlay) {
.example {
/* alternative styles here */
}
}
<link rel="stylesheet" href="http://www.warriordudimanche.net/./plugins/Galart/style.css"/>
<link rel="stylesheet" href="http://www.warriordudimanche.net/./plugins/Galart/assets/lightbox.css"/>
<script src="http://www.warriordudimanche.net/./plugins/Galart/assets/lightbox.js">
<script>[].forEach.call(document.querySelectorAll("[lightbox]"), function(el) { el.lightbox = new Lightbox(el);});► Commentaires