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 10 months ago on June 7th, 2020.


Tags: |

Recommended
The best free alternative to Grammarly : ProWriteAid
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.

5/5 (1 Review)
Do we all agree that Coffee is the fuel that feeds the free content creating?
Connecting Databases to Google Sheets with KPIBees

One of those tools that help connect and process data from Google Sheets to Databases, is KPIBees. Find out more in this post

UseSQL to connected data across Google Sheets, Airtables & More

UseSQL allows you to easily turn your data into databases by connecting data across multiple apps.The data source can be […]

10 Tips For Improving Productivity Of Remote Teams

Freelancers are used to working from home. They can work from anywhere in the world with a decent Internet connection […]

Boost Your Business Strategy With Vizologi

Vizologi is a unique platform helps you shape your business strategy. bringing creative ideas to life. boost tour business strategy.

Online PDF To Flipbook Converter

Heyzine is the best way to create awesome online publications convert PDF to Flipbooks

Landing Pages Optimization: Writing & Design Tips

Landing page optimization writing and design tips to help you build the best landing page for your business, product, and services.

App Development Agency: Here’s Why You Need A Mobile App

Getting credible services from a legit app development agency is essential. Here’s an article to read why an app can help your business.

Leave a Reply

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

menu-circlecross-circle