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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:55:25+00:00 2026-05-27T11:55:25+00:00

I have got an image which i have to used for my headers ,

  • 0

I have got an image which i have to used for my headers , I cant use fixed image as the header width changes depending on the header text, therefore i did 3 slices of an image , starting which wont repeat , middle slice which will repeat with the text and end slice image which should close the header, i have included the image , and the css which i am using , the end slice doesnt works , can anyone tell me what i am doing wrong :

<div class="product-item">
<div class="product-title">

<span><h3>@Model.Name</h3></span>

</div>

</div>

CSS:

.product-grid .product-item .product-title
{
background-image: url('images/first-slice.png');
background-repeat: no-repeat;
background-position: 0% 0%;
height:37px;
 }
.product-grid .product-item .product-title span
{
background-image: url('images/last-slice.png');
background-repeat: no-repeat;
background-position: 100% 50%;
 height:37px;
 }

.product-grid .product-item .product-title h3
{
background-position: 50%;
background-image: url('images/middle-slice.png');
background-repeat: repeat-x;
 height:37px;
 margin-left:5px;
 }

Live test Website:Website

First Image: First-slice
middle Image : enter image description here
End Slice : enter image description here

  • 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-05-27T11:55:25+00:00Added an answer on May 27, 2026 at 11:55 am

    You should change:

    <span><h3>@Model.Name</h3></span>
    

    to:

    <div><h3>@Model.Name</h3></div>
    

    The problem is that span is an inline element, on which setting a height will not work.

    <span><h3>@Model.Name</h3></span> is also invalid HTML.


    As pointed out by @ptriek, you also need to swap the order of backgrounds between elements.

    This is the CSS that you need (assuming that you changed the span to a div):

    .product-grid .product-item .product-title
    {
        background-image: url('images/middle-slice.png');
        background-repeat: repeat-x;
    }
    .product-grid .product-item .product-title div
    {
        background-image: url('images/first-slice.png');
        background-repeat: no-repeat;
        background-position: left;
    }
    .product-grid .product-item .product-title h3
    {
        background-image: url('images/last-slice.png');
        background-repeat: no-repeat;
        background-position: right;
        height: 37px;
        margin-left: 5px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i m making a Polaroid image gallery and for which i have used dynamic
i have form in drupal which uploads images and has got few checkboxes in
I'm trying to build the simple layout that I have got in the image
I have got an ActiveX Control that gets an image from a fingerprint device
I have currently got imagepaths stored within the database and image files stored in
In my android app I have a background image which is longer than the
I'm writing an iPhone app, and I've got an image which I'ld like to
i've got some binary data which i want to save as an image. When
I have got a category - model which i am using it for my
I have a JavaScript function which have been used to post something to the

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.