Q:

Styling a wordpress widget title

I've been struggling with this problem for a while now. How do I style my widget title to have this horizontal line besides my widget title and not under it. Like so:enter image description here

A:

If you have access to the CSS Editor in WordPress, then just use the pseudo class :after to add that underline beside the widget title.
You can see the working demo here: https://jsfiddle.net/j835Lbg2/3/

/* just an example widget */
.widget {
  height: 300px;
  width: 500px;
  background: #ffffff;
  border: 1px solid #cccccc;
  margin-bottom: 30px;
}

.widget-title {
  position: relative;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 16px;
  color: rgba(0,0,0,0.7);
  padding: 12px 12px;
}

/* widget title text */
.widget-title > .widget_name {
  position: relative;
  background: #ffffff;
  padding: 5px 15px 5px 0px;
  z-index: 1;
}

/* widget underline beside the title */
.widget_dash:after {
  content: "";
  position: absolute;
  display: block;
  left: 20px;
  right: 20px;
  top: 25px;
  border-bottom: 1px solid #cccccc;
  z-index: 0;
}
<div class="widget">
  <div class="widget-title">
    <span class="widget_name">WIDGET TITLE</span>
    <span class="widget_dash"></span>
  </div>
</div>

<div class="widget">
  <div class="widget-title">
    <span class="widget_name">ANOTHER WIDGET</span>
    <span class="widget_dash"></span>
  </div>
</div>

Let me know if this helps :)

