×
COME INSERIRE COMMENTI IN CSS

In CSS i commenti vengono creati utilizzando la notazione in stile C, ovvero / * * /.
Tutto il codice che si trova tra / *  * / verrà ignorato dal browser, anche se
i delimitatori si estendono su più righe.

    /* Commento su più
    righe*/

L'uso dei commenti serve a chiarire l'utilizzo del codice. I commenti in CSS si usano anche per migliorare la leggibilità, delimitando sezioni del foglio di stile o fornendo metadati relativi al file, ad esempio il nome dell'autore o la licenza d'utilizzo di un tema.

/*
Theme Name: Twenty Thirteen
Theme URI: http://wordpress.org/themes/twentythirteen
Author: the WordPress team
Author URI: http://wordpress.org/
Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
Text Domain: twentythirteen

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

I commenti sono anche molto utili per "disattivare" momentaneamente le dichiarazioni CSS ai fini di test sui fogli di stile.

    p { /* color: blue; */ }

Cerca

Vuoi scrivere per noi? Guadagna scrivendo articoli per il nostro blog!