我想制作一个菜单,其中每个项目用·分隔.要实现这个我用
menu li:before {
content: "· ";
}
Run Code Online (Sandbox Code Playgroud)
这是膨胀,但它也会在第一个项目之前生成一个点.因此,我也想使用:first-child伪类.我可以这样做吗?
我正在尝试制作一个css选择器,根据天气html是否在iframe中分配不同的属性.我试过这个:
html:not(:root) body {
background: black !important;
}
Run Code Online (Sandbox Code Playgroud)
我希望这适用background: black;于身体,如果它在iframe内部,但它没有,为什么?有没有css选项?如果html是root,我总是可以用javascript检查.
IE8支持不需要支持.
我想为此指令中的每个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) 这是它显示的数据:
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) 我正在尝试在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) 我有一个正则表达式搜索,如下所示:
'\d*.\d*, \d*.\d*'
Run Code Online (Sandbox Code Playgroud)
我想改变'和,,但保持d*.这可能是崇高的文本吗?如果没有,最简单的方法是什么?
由于第三方的愚蠢原因,我需要从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) 我想使用$ 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}},但我找不到任何文件.
我试图实现这个目标:
<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,所以我更倾向于以某种方式在我的视图中添加值.它可能吗?
我有以下模板:
<!--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 ×5
css ×2
css3 ×1
file ×1
macos ×1
osx-lion ×1
pip ×1
pseudo-class ×1
python ×1
regex ×1
replace ×1
sublimetext ×1
sublimetext2 ×1