-1

I have to implement this content separator in my web page using html/css but I cannot find the implementation.

separator

I have the .svg and .png pictures of this flower. Can you show me the steps of doing this, or give me links to some well-explained tutorials. I appreciate any help!

Community
  • 1
  • 1
Luchnik
  • 1,067
  • 4
  • 13
  • 31

3 Answers3

1

Flexbox and a couple of pseudo-elements make this simple.

span {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}
span::before,
span::after {
  content: '';
  flex: 1;
  height: 2px;
  background: teal;
  margin: .5em;
}
<span><img src="http://www.swimmingpoolmosaics.com/images/thumbnails/50/50/variant_image/0/fleur-de-lis-teal.jpg" alt="" /></span>

Related Question

Community
  • 1
  • 1
Paulie_D
  • 107,962
  • 13
  • 142
  • 161
1

A typical HR revisited.

You can use a pseudo to introduce an image on top of it:

hr {
  position:relative;
  margin:2em 1em;
  color:lighgray;
  }
hr:before {
  content:url(http://i1253.photobucket.com/albums/hh600/fleur-de-lis-xxx/favicon-bright.png);
  position:absolute ;
  text-align:center;
  left:50%;
 background:white;
  z-index:1;
  height:2em;
  width:30px;
  margin:-15px;
  
  }
<hr/>
G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129
1

Here's a solution with pseudo element :after

.separator { border-bottom: 1px solid #333; position: relative; margin-top: 30px; }
.separator:after {
  content: ""; 
  position: absolute; 
  left: 50%; 
  margin-left: -25px; /* half of the image width */
  top: -20px; 
  background: url('http://www.swimmingpoolmosaics.com/images/thumbnails/50/50/variant_image/0/fleur-de-lis-teal.jpg') no-repeat #fff;
  width: 50px;
  height: 50px;
}
<div class="separator"></div>
Vincent G
  • 8,547
  • 1
  • 18
  • 36