Solution 1 :

Based on your Question i answered below, without changing or adding extra html code.

let me know for any further.

h3 {
  border-top: 2px solid #1375b0;
  width: 100%;
  float: none;
  display: flex;
}

h3::before {
  content: "";
  display: block;
  position: relative;
  top: 0px;
  left: 0;
  font-size: 36px;
  padding: 25px 35px;
  background-image: linear-gradient(to top, #429ce9 0, #1375b0 100%);
  color: #fff;
  float: left;
  line-height: 0;
  font-weight: 600;
  clip-path: polygon(0 -1%, 100% -1%, calc(100% - 35px) 100%, 0 100%);
}
<h3>Head To Head Comparison Between Merger vs Amalgamation (Infographics)</h3>

Problem :

I have a website and I want to give style to h2 elements on it: https://christmasgenius.com/10-winter-holidays-around-the-world-xmas-vacations/

I have an example website: https://www.educba.com/merger-vs-amalgamation/

If you see the first h3 heading named ”
Head To Head Comparison Between Merger vs Amalgamation (Infographics)”

I want the same style to be applied to my h2 tags. I saw the code and it has the following html which I don’t want to add in my html as it will too much work for all the pages on my website.

<div class="hh-block"><div class="hh-left hh-m-0"><span>&nbsp;</span></div><div class="h-h-title hhright hh-next"><h3>Head To Head Comparison Between Merger vs Amalgamation (Infographics)</h3></div></div>

My question is, can I achieve the same style on my h2 tags by just using CSS and provide some code for the same.

Comments

Comment posted by Jesse

Have you looked at the CSS applied to the classes on those tags?

Comment posted by Piyush-Ask Any Difference

@Jesse yes but that css is applied on the outer html tags on his h3 tags, since my html structure is different than him, I can’t directly use his CSS for my h2

Comment posted by sanoj lawrence

@Sandeep are you looking for that style?? you can do it by adding

Comment posted by Piyush-Ask Any Difference

You are the guy!!. Thanks a million

By