css unicode
CSS class name structure and consistency is really important; some developers camelcase classnames, others use dashes, and others use underscores. One thing I've learned when toying around by HTML and CSS class names is that you can actually use unicode symbols and icons as classnames. Check this out!
CSS类名称的结构和一致性非常重要; 一些开发人员使用驼峰式类名,其他开发人员使用破折号,而其他开发人员则使用下划线。 我在遍历HTML和CSS类名时学到的一件事是,您实际上可以使用Unicode符号和图标作为类名。 看一下这个!
HTML和CSS (The HTML and CSS)
There's only one way to add a classname with HTML so you'll do it that way, of course:
只有一种方法可以使用HTML添加类名,因此您当然可以这样做:
<!-- place this within the document head -->
<meta charset="UTF-8" />
<!-- error message -->
<div class="ಠ_ಠ">You do not have access to this page.</div>
<!-- success message -->
<div class="❤">Your changes have been saved successfully!</div>
...and there's only one way to declare styles for a given class:
...并且只有一种方法可以声明给定类的样式:
.ಠ_ಠ {
border: 1px solid #f00;
background: pink;
}
.❤ {
background: lightgreen;
border: 1px solid green;
}
Wild that you can use unicode classnames for elements, right? Of course I don't recommend doing so, but you can if you'd like to!
可以为元素使用unicode类名,对吗? 当然,我不建议您这样做,但是如果您愿意,可以这样做!
css unicode