Angular定义了一些css类,如ng-hide等。它是如何以及在何处进行的?在angular.js我有一个可能的定义:
* ### Overriding .ng-hide
*
* By default, the `.ng-hide` class will style the element with `display:none!important`. If you wish to change
* the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
* class in CSS:
*
* ```css
* .ng-hide {
* /* this is just another form of hiding an element */
* display:block!important;
* position:absolute;
* top:-9999px;
* left:-9999px;
* }
* ```
如果真的是这个定义,```css语法是什么?什么都没发现。
答案 0 :(得分:1)
Angular定义了一些css类,如ng-hide等。
不,它没有。这些是 HTML类。
没有CSS类这样的东西。 CSS具有类选择器,允许您根据元素成员的类别将元素应用于元素。
Angular主要使用HTML类来选择使用JavaScript的元素,而不是CSS。
可以在源代码树的the CSS directory中找到使用CSS的少数几个区域。
那什么是```css语法?
那不是CSS。这是降价。这意味着“这是一段代码”。您正在查看文档的源代码。它将由markdown(以及可能是JSDoc之类的工具)解析并转换为HTML。
答案 1 :(得分:0)
您正在查看旨在用作文档的注释,而不是实际代码。
如果向右滚动到angular.js
文件的底部,您会看到一行以:
!angular.$$csp() && angular.element(document).find('head').prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}</style>');
定义实际CSS的位置。其中并没有那么多,而且它几乎只限于隐藏这样的东西。