在CSS3或JS中重复对角线虚线?

时间:2013-07-04 22:32:22

标签: javascript css html5 css3

我仍然是html / css / js的新手,我正试图找到解决我通常以非常糟糕的方式解决的问题的方法。通常情况下,我会尝试创建某种无缝的photoshop模式,然后将其作为.png重复一小时。看到人们使用CSS3完成所有这些令人敬畏的事情(动画,什么!),我认为这不会太难。我不知道怎么开始。

我想要做的是以下内容:

基本上,这个模式:// / /////// /(重复:// / /////// / // / /////// /),除了每个线条,而不是实线,点缀。

如下所示:

enter image description here

2 个答案:

答案 0 :(得分:1)

为此,我只想使用SVG,它在CSS中将如下所示:

.your_element{
background-image: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD//gAEKgD/4gv4SUNDX1BST0ZJTEUAAQEAAAvoAAAAAAIAAABtbnRyUkdCIFhZWiAH2QADABsAFQAkAB9hY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAA9tYAAQAAAADTLQAAAAAp+D3er/JVrnhC+uTKgzkNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBkZXNjAAABRAAAAHliWFlaAAABwAAAABRiVFJDAAAB1AAACAxkbWRkAAAJ4AAAAIhnWFlaAAAKaAAAABRnVFJDAAAB1AAACAxsdW1pAAAKfAAAABRtZWFzAAAKkAAAACRia3B0AAAKtAAAABRyWFlaAAAKyAAAABRyVFJDAAAB1AAACAx0ZWNoAAAK3AAAAAx2dWVkAAAK6AAAAId3dHB0AAALcAAAABRjcHJ0AAALhAAAADdjaGFkAAALvAAAACxkZXNjAAAAAAAAAB9zUkdCIElFQzYxOTY2LTItMSBibGFjayBzY2FsZWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAACSgAAAPhAAAts9jdXJ2AAAAAAAABAAAAAAFAAoADwAUABkAHgAjACgALQAyADcAO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ALGG+IR6GM539Nar7gxWEixhUlKKo4jGgDieACAzkjWMUyLxDa7Ing4g3Isq78Zjz8zaAHvOMIIZ/cjFC82IQwqwAK5OLXQaU7OfWUjWbP7qEZMr/Yfwy9hyz7/7MHcpf2jwuC93iA2MrqIwI23rqVDwnErTWRLEKJRB1jNQtE35VzMViFPxKEaHAZX3qU00BAhxneG2JURe9dzbxvSQFg88j2QcZmmee4e91eSbw2HhOZQjnLMaFTD5iOPwhXkyhaITFNDEp57mZbYBWuJYWox2S1XTlcRyAN08yhYHPM00eaC4FSg3Z7xsdVovlWPtUwjfP3QZVU1kDXtaXtdWjBXAdQjWDh6f1L4GS0OvEyapKPMprhGUanuX+hTCAMbOdE4jEaq+oIKBhvM0SjAUdEiWNNkSzuULt7KsPWUrPSXywrBX7i8ErGfJUeIOI7tti6XxHvIcLUu3I2V/fESYKWpqPFrM8Q79KzflmcuWHhiwbRoyMthbNjHNlrvmLeYUFrcBdsAR3Wpa4mYgDduI5VGSOCKaCq6/8IqVfdMQLHZnkTBFHJwbgkC7XASZGsMLa6mADhLRH55XaL7gleYyp3n6DKt+sXzLmZV9xaO547jaUgEKWVH5PHmXupGo0gZcQTMKlIcZSDmv2gxRpWvMeEN6YXQiwnjMVOrX5iVGeTiLmXH6AdcS/af/2Q==);
}

您可以使用此工具转换图片: SVG data URI convertor

你也可以在CANVAS中创建,但我相信它的性能会更加昂贵。

答案 1 :(得分:0)

你可以设置2个渐变作为背景,1创建线条(transparents),另一个创建剥离图案,通过透明线条看到以创建虚线错觉

CSS。

.test { 
    width: 300px;
    height: 300px;
    background-image: repeating-linear-gradient(45deg, white 4px, transparent 5px, white 6px, white 10px, transparent 11px, white 12px, white 20px), 
    repeating-linear-gradient(0deg, white 4px, black 5px, black 9px, white 10px, white 20px);
}

fiddle