3

I am writing a Python module that will be doing some css manipulations and modifications. As of my knowledge, the css template is:

selector{
    property:value;
}

my question is, is there any instance where value contains a colon?

The reason for this is that I want to split the lines inside selectors by a colon and essentially grab the property and the value, but if the value has a colon in it, then the entire function will manipulate the css incorrectly.

4

2 回答 2

7

是的。

如果您指定过滤器 (IE),则它包含第二个冒号。

例子:

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fad59f', endColorstr='#fa9907')

任何带有 url 的 CSS 属性都可以很容易地包含http:

例子:

background-image: url("http://example.com/image.jpg");
于 2013-07-24T15:03:00.297 回答
5

是的,例如:

selector:before{
    content:":";
}
于 2013-07-24T15:03:41.703 回答