PIT Designs Logo

Title With Lines On Sides in Oxygen (CSS Only)

About the author: Ninos
I'm the owner and founder of PIT Designs. I love creating digital presence and creative digital solutions for our clients.


Posted 1 month ago on June 7th, 2020.


Tags: |

Working on a website, I needed to create a title with lines on sides.

A sort of text-decoration-cool-design-thing.

That looks like this

Title-With-Lines-On-Sides-(CSS)
from: functionandform.com.au

A quick search online gave me, some plugins, shortcodes.. and there was something about Elementor, that adds a bunch of divs for this...

No!

All you need is a text or heading element and some CSS.

So, I thought I'd share with you, how I created that with CSS only, inside of Oxygen builder.

The trick is, ::before [title] ::after

Fancy Title

Let's add a heading, and give it a class fancy-title

And apply this CSS to the fancy-title

.fancy-title {
  display: inline-block;
  position: relative;  
  line-height: 1px;
  margin-top: 1em;
  margin-bottom: 0.8em;
}

The Lines (Pseudo-Elements)

Work the magic of CSS. The fancy title needs to have a before and after Pseudo-element which will act as the lines on both sides of the title.

.fancy-title:before, .fancy-title:after {
  content: "";
  position: absolute;
  height: 5px;
  border-bottom: 1px solid #afafaf;
  border-top: 1px solid #afafaf;
  top: 0; 
  width: 40%;
}

.fancy-title:before {
  right: 100%;
  margin-right: 15px;
}

.fancy-title:after {
  left: 100%;
  margin-left: 15px;
}

Make it your own!

The code above is what I used to create the sample shown. However, you can easily adjust the values, such as width, border color, etc.. To match your design.

0/5 (0 Reviews)
Do we all agree that Coffee is the fuel that feeds the free content creating?
How to Choose Commercial Cleaning in Erbil

How to find the right company for commercial cleaning in Erbil - Iraq? With the current global pandemic situation, work […]

Is 2020 a Good Time to Start a Career in Tech?

In terms of demand, the tech field has become what in the past used to be the stock market. Back […]

Interview & Business Lessons From Paul's Hair Port

It is a remarkable milestone when a business celebrates its 20th year anniversary in business. Paul’s Hair Port, located in […]

Should You Trust Kuraz Insurance Company in Erbil?

Kuraz insurance company based in Erbil. Claims to be professionals in the business of ensuring your health, assets, travel, and […]

How to Create Before & After Slider in Oxygen

Before & After slider is a cool effect, used to provide a real-time sense of comparison of two images. If […]

Title With Lines On Sides in Oxygen (CSS Only)

Working on a website, I needed to create a title with lines on sides. A sort of text-decoration-cool-design-thing. That looks […]

How to Create Animated Number Counters in Oxygen

Animated number counters are seen on many landing pages. They bring a cool effect (movement) to the page and convey […]

Leave a Reply

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.

chevron-downmenu-circlecross-circle