PIT Designs Logo

Title With Lines On Sides in Oxygen (CSS Only)

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


Posted 1 year ago on June 7th, 2020.

Related To:

Tags: |

pCloud Lifetime Up to 35% OFF AliDropship Plugin

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.

4/5 (2 Reviews)
Do we all agree that Coffee is the fuel that feeds the free content creating?
How to Optimize Marketing Content to Get Hits Among International Customers

Whether you operate as a small business or an international company, reaching out to potential customers worldwide is always a […]

How Mobile Apps Can Help In Optimizing Business Growth

With the increase in the use of smartphones all around the world, businesses nowadays are finding new ways to connect […]

10 Greatest Challenges the Virtual Teams are Facing Now

The advance of technology has made it easy to work with different teams across different geographic locations. A ship manufacturer […]

Emerging Trends & Technologies in the Automobile Sector

The automotive industry is changing substantially as the time passes and the technological innovations are the reason behind this change. […]

5 Famous Entrepreneurs & Their Way to Success

 In business, if you want to reap success, it’s important to look at past stories of successful entrepreneurs. This article […]

5 Effective Customer Engagement Strategies

Do you know that customers are the lifeblood of business? And without them, a business cannot survive?  According to a […]

Extract Data From Any Website with RTILA

Some websites can contain a very large amount of data, such as companies contacts, product details and prices, images, stats, […]

Leave a Reply

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

menu-circlecross-circle