John Dorsey John Dorsey -5 years ago 140
CSS Question

Create background right of heading

I am trying to convert PSD to HTML/CSS template.

I wanted to put that background to the right of the text but I failed.

Here is my code right now :

<div class="col-md-3">
<div class="block-main">
<div class="block-title">

Button image

Answer Source

Use a pseudo-element and flexbox

h4 {
  display: flex;

h4::after {
  content: '';
  background: repeating-linear-gradient(
  gray 6px,
  black 6px,
  black 12px
  margin-left: 1em; /* for spacing only */

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download