Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:57:36+00:00 2026-06-12T07:57:36+00:00

I have made some a fiddle of such a headline that I need. CSS:

  • 0

I have made some a fiddle of such a headline that I need.

CSS:

body {
    background:url("http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/tiny_grid.png");
}

.main-container {
    width: 600px;
    margin: 0 auto;
    box-shadow:0 0 5px #d00;
}

.headline {
    display: inline-block;
    margin: 40px 0;
    padding: 0 30px;
    font: normal 33px/1.1 Georgia, "Times New Roman", Times, serif;
    color: #3E3E3E;
    height: 1px;
    border-left: 300px solid #aaa;
    border-right: 300px solid #aaa;
    white-space: nowrap;
}

.headline > span {
    display:block;
    margin-top:-17px;
}

HTML:

<div class="main-container">
    <h1 class="headline"><span>OUR LATEST WORKS</span></h1>
</div>

This is not the full solution, because I use the borders around the text that push out the text from the parent container.

Is there any other ways to do it? But without additional divs and JS.

PS: The background image may be different, so I already try to put the same bg under the text but it’s not the solution.

PPS: The “div.main-container” must no contain the overflow:hidden

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:57:37+00:00Added an answer on June 12, 2026 at 7:57 am

    I came up with something like this http://jsfiddle.net/olgis/qkNfm/, similar to @GionaF solution just without fixed width, but still you will need a container to get red line underneath the text.

    As I understand your criteria for solution is:

    • any background
    • NO JavaScript or jQuery
    • css liquid layout (NO fixed width)
    • minimal HTML
    • cross browser solution

    In this post http://www.impressivewebs.com/centered-heading-horizontal-line/, they are discussing “Centered Heading Overlaying a Horizontal Line with CSS” a lot of different solutions as well as a cross platform issue.

    My guess would be you are aiming for something like this http://result.dabblet.com/gist/1560674
    a neat solution with just one H1 .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT #2: Made a JS Fiddle... http://jsfiddle.net/N2p6G/ (I hardcoded some stuff that I'm certain
I have recently made changes in some code that makes a char name field
I have a problem where I need to line up some DIVs. I made
I need some help. I'm looking to have a sidebar that toggles when a
ASP.NET 4.0 Need some help with this vexing HTTP POST problem - I have
I have made some code that makes powerpoint and excel work together. And I
I have made some custom attached properties that enable me to create a pop
I have made some small macro that I am using to display text line
In this fiddle : http://jsfiddle.net/peey/bbseQ/1/ , i have tried to hyperlink a triangle made
I have made some code that creates a red border around an image when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.