html - 元素内的边框图像(插图)

标签 html css

我有一个 png 文件 (1603px x 75px),我想将其用作某个部分的边框。但我希望它出现在内部(插图)而不是外部。但我无法弄清楚如何使边框图像恰好进入(插入)图像高度,而不会使图像的垂直尺寸变形。

html:

    <section class="intro viewportheight_min" id="intro">

样式:

body, html, .container, section {
  height: 100%;
}
/*.container{margin:0 auto;}*/
section {
    width:100%;
    text-align:center;
}
section.intro {
/*  border-color:#06b4c8;*/
/*  border-style:solid;*/
/*  border-width:0 0 75px 0;*/
/*  -moz-box-sizing: border-box;*/
    padding-top: 1%;
    border-style: solid; 
    border-width: 0px 0px 75px 0px;
    -moz-border-image: url(../img/vague.png) 0 0 75 stretch;
    -webkit-border-image: url(../img/vague.png) 0 0 75 stretch; 
    -o-border-image: url(../img/vague.png) 0 0 75 stretch; 
    border-image: url(../img/vague.png) 0 0 70 fill stretch; 
}

最佳答案

尝试将 box-sizing: border-box; 属性添加到 section.intro 规则:

section.intro {
    ...
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

http://jsfiddle.net/VL5Gw/

关于html - 元素内的边框图像(插图),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19861330/

相关文章:

jquery - 缩放图像以填充父容器

HTML:图像具有绝对位置,文本流过。怎么做?

html - 如何找到具有全范围字体粗细的网络字体?

jquery - 使用easing1.3.js弹跳 Sprite 图标

jquery - 使用 jquery 禁用 css 类,就像使用 firebug 一样,可能吗?

c# - 删除指定设计样本中的标签间距

javascript - html5 canvas.toDataURL 输出尺寸大于原始图像尺寸

jquery - 将下拉列表中的箭头图标更改为我想要的任何图标

html - :Hover Css Menu doesn't open on iOS Safari ONLY.

HTML - 对齐单选按钮和文本