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 8644037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:11:53+00:00 2026-06-12T12:11:53+00:00

I am looking or a way to include two images left and right to

  • 0

I am looking or a way to include two images left and right to a title span. The problem I am facing is, that this title will in some cases be stretched across two lines, however not always. I do not want to include two extra elements before/after or after the title but am instead looking for a way to achieve what I am trying without adding new elements to the code. I was therefreo hoping to use :before and :after. This is what I came up with:

.block-title:before { position:absolute; content:""; display:inline-block; width:28px; height:14px; margin:2px 0 0 -36px; background:url(../images/sidebar_ornament_l.png) no-repeat 0 0; }
.block-title:after { position:absolute; content:""; display:inline-block; width:28px; height:14px; margin:2px 0 0 9px; background:url(../images/sidebar_ornament_r.png) no-repeat 0 0; } 

While this will work great, if the title is only one line, titles that will take up two lines, will not behave the way, I would want them to, but instead will look like this:

title wrong

I have tried everything I could think of, to make the :before and :after pseudoelements behave as I want them to, changing position and display, chaing the actual text span position, etc but just couldn’t achieve what I want to.

Since I want the two images to align next to the actual text span, a single background image won’t work. The spacing between the text and the image would be too big in some cases, which will look odd. Is there a way to make this work, so I will end up with something like this for two line titles:

title corrected

Thank you!

  • 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-12T12:11:54+00:00Added an answer on June 12, 2026 at 12:11 pm

    Well, this is a general concept, i need your full code to provide a specific answer.

    Anyway, check this demo

    HTML:

    <span class="block-title">Some text is here</span>
    <hr>
    <span class="block-title">Some more text<br>is here</span>
    <hr>
    <span class="block-title">Even<br>more text<br>is here</span>
    

    CSS:

    .block-title {
        position:relative;
        display:inline-block;
        text-align:center;
        padding:0 34px; /* width of your ornament + 6px per each side,
                            adjust to your actual layout */
    }
    .block-title:before, .block-title:after {
        content:" ";
        width:28px;
        height:14px;
        position:absolute;
        top:50%;
        margin-top:-7px; /* half of ornament's height */
    }
    .block-title:before {
        background:url(../images/sidebar_ornament_l.png) no-repeat 0 0;
        left:0;
    }
    .block-title:after {
        background:url(../images/sidebar_ornament_r.png) no-repeat 0 0;
        right:0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem is that I was looking for way to use both storyboard and
I am looking for a way to display two png images (in fact, it
I was looking at this post that describes a simple way to do databinding
I am looking for a quick way to grab some data off of one
Hi I'm using this module pattern variant and I'm looking for the best way
I'm looking to run two sites off one Sitecore install. The first site will
I'm looking for a way to split a string containing HTML in to two
I'm looking for a way to merge two configuration objects together, something like: var
Looking for some branching strategies for a situation that has come up for a
I am right now looking for a way for a user to open a

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.