简体   繁体   English

CSS/HTML 自定义框架/效果

[英]CSS/HTML Custom Frame/Effect

I'm trying to figure out how to create custom enclosure of a div widget.我试图弄清楚如何创建 div 小部件的自定义外壳。

Below is the code that I have came up and I would like to add a custom frame/effect to it.下面是我提出的代码,我想为其添加自定义框架/效果。 Can it be done with HTML/CSS?可以用 HTML/CSS 完成吗? Thanks for the help.谢谢您的帮助。

{<div class="container-fluid">
<section class="p-t-3 p-b-2" id="categories">
    <div class="categories">
        <div id="froala-editor">
            <div>
                <div class="row">
                    <div class="col-xs-12 text-center">
                        <div>
                            <h3 style="display: inline-block;">
                                <br>
                                </h3>
                            </div>
                        </div>
                    </div>
                    <div class="row center-block">
                        <div class="col-xs-12 col-sm-6 col-md-3">
                            <div class="category" style='background-image: url("");'>
                                <a class="category-link" href="" rel="noopener noreferrer" target="_blank">
                                    <span class="category-content">
                                        <span class="category-title">Downtown</span>
                                        <span class="category-subtitle">
                                            <span class="btn btn-primary">View Listings</span>
                                        </span>
                                    </span>
                                </a>
                            </div>
                        </div>}

You can make custom borders by using border-image property:您可以使用border-image属性制作自定义边框:

Example: To apply border on .container-fluid示例:在.container-fluid上应用边框

.container-fluid {
  border: 10px solid;
  border-image: url(https://source.unsplash.com/aDIDvOG021w/) 30 round;
}

You can replace the image with the image of your choice.您可以将图像替换为您选择的图像。

Codepen: https://codepen.io/manaskhandelwal1/pen/RwGYQgR代码笔: https://codepen.io/manaskhandelwal1/pen/RwGYQgR

To apply border on.container-fluid在.container-fluid 上应用边框

.container-fluid {
  border: 10px solid;
  border-image: url() 30 round;
}

You can add an image with the image of your choice inside the url().您可以在 url() 中添加带有您选择的图像的图像。 That'll help you to get more customized color or you can add solid color as:这将帮助您获得更多自定义颜色,或者您可以添加纯色:

.container-fluid {
  border: 10px solid;
  border-image: url() 30 round;
  border-color: coral;
}

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

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