How can I create a similar design using HTML/CSS?
https://i.sstatic.net/o5xzn.png
Solution requirements:
- An icon or small image in the center.
- Responsive design that works with current breakpoints.
- The line should not span 100% width of the screen.
I've explored examples on stack overflow, but none quite match what I need.
Although this sample is exactly what I want, it's an image and I can't view the source.
Below is my code, but it has two issues.
<div style="height: 1px; background-color: grey; text-align: center;">
<span style="position: relative; top: -2.25em; padding: 5px;">
<img src='https://upload.wikimedia.org/wikipedia/commons/9/9d/Alpha_transparency_image.png' alt="text" style="width:80px;height:80px;"></span>
</div>
https://i.sstatic.net/eiitk.png (Also see this Fiddle)
1) Image transparency causes the line to appear over it. Is there a way to rectify this?
2) The line spans 100% width when it shouldn't.
Thank you!
Edit: Resolved the width issue with (width 80%, margin: 0 auto)