简体   繁体   English

带边框图像的虚线边框

[英]Dashed border with border-image

I have three overlaying layer 2 with background image and 11 or the content.我有三个覆盖层 2 与背景图像和 11 或内容。

In the content i placed a input button tag with dashed boarder.在内容中,我放置了一个带有虚线边框的输入按钮标签。

what i was trying to achieve is to get the same background layer image from layer 1 only on the dashes.我试图实现的是仅在破折号上从第 1 层获取相同的背景图层图像。

Obvious background:transparent isn't working so for second choice i used the input boarder and tried to mock this behavior by setting boarder-image to the background image from layer 1.明显的背景:透明不起作用,所以对于第二个选择,我使用输入边界并尝试通过将边界图像设置为第 1 层的背景图像来模拟这种行为。

在此处输入图片说明

.button {
font-family:verdana, sans-serif;
font-size: 20px;
font-weight: bold;
background: transparent;
border-width:5px;
border-style:dashed;
border-color: black; }

So all dashes around the submit button should have the same background like the first layer on the left所以提交按钮周围的所有破折号都应该具有与左侧第一层相同的背景

I changed it to:我把它改成:

在此处输入图片说明

.button {
font-family:verdana, sans-serif;
font-size: 20px;
font-weight: bold;
background: transparent;
border-width:5px;
border-style:dashed;
border-color: black;
border-image: url(/img/bg1.jpg); }

i don't have any idea how to achieve the dashed look with boarder-image我不知道如何使用 boarder-image 实现虚线外观

with: border-image: url(/img/bg1.jpg) 30 30 round;与:边框图像:url(/img/bg1.jpg)30 30轮;在此处输入图片说明

http://jsfiddle.net/6vKdh/3/ http://jsfiddle.net/6vKdh/3/

CSS border-image Syntax is like this: CSS border-image语法是这样的:

border-image: source slice width outset repeat|initial|inherit;

So you are missing something there.所以你在那里错过了一些东西。

try replace your border-image尝试替换您的border-image

border-image: url(/img/bg1.jpg);

for this example:对于这个例子:

border-image: url(/img/bg1.jpg) 30 30 round;

for more Documentation look at this : CSS3 Border-Image有关更多文档,请查看: CSS3 Border-Image

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM