Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border image not displaying

I am using border image code something like this, but it is not working:

CSS:

#container{
    float:left;
    position:absolute;
    font-size:56px;
    font-family:arial;
    top:400px; left:200px;
    border-bottom-image:url(images/border_bg.png);
    -webkit-border-image:url(images/border_bg.png) 30 30 round; 
    -o-border-image:url(images/border_bg.png) 30 30 round;
    border-image:url(images/border_bg.png) 30 30 round;"
}

HTML:

<div id="container">WE'VE GOT YOU COVERED.</div>
like image 768
BigTech Avatar asked Sep 18 '13 09:09

BigTech


People also ask

Why is border not showing up?

CSS Border Not Showing If you've set the shorthand border property in CSS and the border is not showing, the most likely issue is that you did not define the border style. While the border-width and border-color property values can be omitted, the border-style property must be defined. Otherwise, it will not render.

Why is my border image not showing up CSS?

You need to set a border width and style in order to create some space for the border image to appear.

How do I add a border to an image in HTML?

The <img> border attribute is used to specify the border width around the image. The default value of <img> border attribute is 0.


1 Answers

You have some syntax errors.

Here is a working example:

#container {
    font-size:56px;
    font-family:arial;
    border-width: 50px;
    border-style: solid;
    border-image: url(http://placekitten.com/100/100) 25% round;
}

You need to set a border width and style in order to create some space for the border image to appear.

See reference: http://www.w3.org/TR/css3-background/#border-images

See demo at: http://jsfiddle.net/audetwebdesign/JdEkB/

like image 144
Marc Audet Avatar answered Sep 28 '22 18:09

Marc Audet