Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74735

What is the different way to do heading underline stylish?

$
0
0

I want to do the same things as below but in a different way using CSS.

Slanted underline using CSS

.container {
  width: 100%;
  padding: 50px;
  display: block;
}

h2 {
  font-size: 35px;
  line-height: 1.2;
  margin: 0;
  width: 500px;
}

.heading-border {
  position: relative;
  background: url('https://i.ibb.co/PM2s0mj/green-shape.png');
  background-size: 100% 8px;
  background-position: bottom;
  background-repeat: no-repeat;
}

.heading-border:before {
  content: '';
  background: #fff;
  height: 13px;
  width: 12px;
  display: inline-block;
  margin: 0px 0px -8px -6px;
  transform: rotate(-45deg);
}

.heading-border:after {
  content: '';
  background: #fff;
  height: 13px;
  width: 12px;
  display: inline-block;
  margin: 0px -6px -17px 0;
  transform: rotate(-45deg);
}
<div class="container"><h2>This is heading <span class='heading-border'>this is stylish heading line</span></h2></div>

This has happened when I used a background color http://prntscr.com/ny8uog

I want the same things as I mentioned in the above code but in a different way so if I will use background color in behind of heading then the patch should not be visible.


Viewing all articles
Browse latest Browse all 74735

Latest Images

Trending Articles



Latest Images