小编Him*_*ors的帖子

可以在css中使用多个伪元素吗?

我想制作一个菜单,其中每个项目用·分隔.要实现这个我用

menu li:before {
    content: "· ";
}
Run Code Online (Sandbox Code Playgroud)

这是膨胀,但它也会在第一个项目之前生成一个点.因此,我也想使用:first-child伪类.我可以这样做吗?

css pseudo-class pseudo-element

18
推荐指数
1
解决办法
2万
查看次数

当html文档在iframe中时的Css选择器?

我正在尝试制作一个css选择器,根据天气html是否在iframe中分配不同的属性.我试过这个:

html:not(:root) body {
    background: black !important;
}
Run Code Online (Sandbox Code Playgroud)

我希望这适用background: black;于身体,如果它在iframe内部,但它没有,为什么?有没有css选项?如果html是root,我总是可以用javascript检查.

IE8支持不需要支持.

css css3

16
推荐指数
2
解决办法
2万
查看次数

如何为指令的每个实例添加唯一ID?

我想为此指令中的每个div添加一个唯一的ID,以便我可以指定google maps应该传递的元素:

directive('gMap', function(googleMaps){
return{
        restrict: 'E',
        replace: true,
        transclude: true,
        template: "<div id="{{unique_ID}}"></div><div ng-transclude></div>",
        scope: true,
        link: function(scope, element, attrs){


            //create the map
            var center = googleMaps.makePosition(attrs.centerlat, attrs.centerlong)
            //update map on load
            var options = googleMaps.setMapOptions(center, attrs.zoom);
            scope.map = googleMaps.createMap(options, unique_id)    
        },
    };
}).
Run Code Online (Sandbox Code Playgroud)

angularjs

15
推荐指数
3
解决办法
3万
查看次数

我从chrome:// cache恢复了一个文件,我该如何阅读?

这是它显示的数据:

http://krill.larvit.se/resihop_dev/style.css
HTTP/1.1 200 OK
Date: Tue, 17 Jul 2012 20:36:17 GMT
Server: Apache/2.2.16 (Debian)
Last-Modified: Mon, 16 Jul 2012 23:33:42 GMT
ETag: "3003d8-92f-4c4fadc326180"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 871
Content-Type: text/css
00000000:  4a  01  00  00  03  08  00  00  68  fc  1b  c8  a2  23  2e  00  J.......h....#..
00000010:  c4  c4  1c  c8  a2  23  2e  00  0f  01  00  00  48  54  54  50  .....#......HTTP
00000020:  2f  31  2e  31  20  32  30  30  20 …
Run Code Online (Sandbox Code Playgroud)

google-chrome file

14
推荐指数
0
解决办法
1万
查看次数

尝试在Mac OS X Lion中安装pip时出现权限被拒绝错误

我正在尝试在Mac上安装pip(OS X Lion).它似乎不起作用.我使用sudo并提示输入密码.

$ sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 85929  100 85929    0     0  63833      0  0:00:01  0:00:01 --:--:-- 99339
Downloading/unpacking pip
  Downloading pip-1.2.tar.gz (94Kb): 94Kb downloaded
  Running setup.py egg_info for package pip

    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
    no previously-included directories found matching 'docs/_build/_sources'
Installing collected packages: …
Run Code Online (Sandbox Code Playgroud)

python macos pip osx-lion

14
推荐指数
1
解决办法
4万
查看次数

是否可以使用regexp作为变量在sublime文本中进行查找和替换?

我有一个正则表达式搜索,如下所示:

'\d*.\d*, \d*.\d*'
Run Code Online (Sandbox Code Playgroud)

我想改变',,但保持d*.这可能是崇高的文本吗?如果没有,最简单的方法是什么?

regex replace sublimetext sublimetext2

13
推荐指数
1
解决办法
1万
查看次数

从html访问$ scope?

由于第三方的愚蠢原因,我需要从html访问$ scope.

这就是我正在尝试的:

<html ng-app>
    <!-- head goes here-->
    <body>
        <!--Body goes here-->
        <script type="text/javascript">
            console.log($scope);
        </script>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

angularjs

13
推荐指数
1
解决办法
2万
查看次数

有条件地添加角度属性

我想使用$ scope来设置是否应该在angular中使用属性.这是我的范围:

fields:
    [
        {
            label: 'First Name',
            name: 'firstname',
            key: 'entry.326845034',
            type: 'text',
            required: true
        }
    ]
Run Code Online (Sandbox Code Playgroud)

这是我想要设置的必需属性.我想象的东西{{if fields.required == true | required}},但我找不到任何文件.

angularjs

11
推荐指数
1
解决办法
8985
查看次数

我可以在模板中使用ng-model为输入设置默认值吗?

我试图实现这个目标:

<input name="formkey"
       ng-model="formkey"
       value="1_4bKU-Be3K4sMuoQTDHfz7uMqGd9N9fU6bGd1EjEu8s"
>
Run Code Online (Sandbox Code Playgroud)

要么:

<input type="hidden" 
       name="formkey"
       ng-model="formkey" 
       value="1_4bKU-Be3K4sMuoQTDHfz7uMqGd9N9fU6bGd1EjEu8s"
>
Run Code Online (Sandbox Code Playgroud)

当我在浏览器中查看它时输入为空.如果我删除ng-model="formkey"它工作,所以我假设空的formkey值覆盖我的值.

我知道我可以使用javascript为范围添加值.但我在很多不同的视图中使用相同的javascript,所以我更倾向于以某种方式在我的视图中添加值.它可能吗?

angularjs

11
推荐指数
2
解决办法
2万
查看次数

为什么我会得到Lexerr:未终止的报价错误?

我有以下模板:

<!--Votez pour ce concept de bar:-->
<p ng-show="enabled('http://ballentines.herokuapp.com/{{finalist.slug}}.html') === 'novote'">Not voted</p>

<!-- Vous avez voté pour ce concept de bar-->
<p ng-show="enabled('http://ballentines.herokuapp.com/{{finalist.slug}}.html') === 'thisvote'">
    Voted for this concept
</p>

<!--Vous ne pouvez voter que pour un seul concept de bar -->
<p ng-show="enabled('http://ballentines.herokuapp.com/{{finalist.slug}}.html') === 'othervote'">
    Voted for another concept
</p>
Run Code Online (Sandbox Code Playgroud)

当我尝试运行它时,我明白了

Error: [$parse:lexerr] Lexer Error: Unterminated quote at columns 8-57 ['http://ballentines.herokuapp.com/{{finalist.slug] in expression [enabled('http://ballentines.herokuapp.com/{{finalist.slug].
http://errors.angularjs.org/1.2.11/$parse/lexerr?p0=Unterminated%20quote&p1=s%208-57%20%5B'http%3A%2F%2Fballentines.herokuapp.com%2F%7B%7Bfinalist.slug%5D&p2=enabled('http%3A%2F%2Fballentines.herokuapp.com%2F%7B%7Bfinalist.slug
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

angularjs

11
推荐指数
2
解决办法
1万
查看次数