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

  • Home
  • SEARCH
  • 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 8858481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:50:20+00:00 2026-06-14T14:50:20+00:00

I am working on a WordPress template. I am trying to implement 3 background

  • 0

I am working on a WordPress template. I am trying to implement 3 background images to be used for each <li> in the nav menu, which is generated dynamically. Take a look at the two examples.

http://preahkumpii.com/misc/test01/hi.html
http://preahkumpii.com/misc/test02/hi.html

First Example CSS:

.menu-item li {
  background-image: url(images/menu-left.png), url(images/menu-right.png), url(images/menu-center.png);
  background-position: left, right, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

Second Example CSS:

.menu-item li {
  background-image: url(images/menu-left.png), url(images/menu-right.png), url(images/menu-center.png);
  background-position: left, right, center;
  background-repeat: no-repeat, no-repeat, repeat-x;
}

HTML:

<ul class="menu-item">
  <li>ItemNumber1</li>
  <li>ItemNumber2</li>
  <li>ItemNumber3</li>
</ul>

I want the two outer bg images to stay where there are with no repeat. But, I want the middle bg image to repeat along the x-axis, but only extend to the other bg images. As you can see in the second example, when the middle image is given repeat-x it extends across the entire <li>. As far as I know, I cannot use <div> to make this happen because the text for the menu is generated on the fly. So, I assume I must have only a <ul> without a bunch of <div>s hanging around. Any help?

  • 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-14T14:50:21+00:00Added an answer on June 14, 2026 at 2:50 pm

    hey you can use the after-before pseudo class for your desired results.

    See the CSS how i made it :-

    CSS

    .menu-item li:after {
        background: url("images/menu-center.png") repeat-x scroll 0 0 transparent;
        bottom: 0;
        content: " ";
        left: 20px;
        position: absolute;
        right: 20px;
        top: 0;
        z-index: -1;
    }
    .menu-item li {
        background-image: url("images/menu-left.png"), url("images/menu-right.png");
        background-position: left center, right center;
        background-repeat: no-repeat, no-repeat;
        display: inline-block;
        height: 56px;
        line-height: 56px;
        min-width: 60px;
        padding: 0 20px;
        position: relative;
        text-align: center;
        z-index: 1;
    }
    

    See the output how i have done itenter image description here

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

Sidebar

Related Questions

My wordpress*(a custom template)* nav is all working on all of the pages but
i'm having a little problem. I'm working on a wordpress template which lists all
I am working with WordPress and I am trying to modify my template so
i'm currently trying to implement UPLOADIFY to a wordpress template page. I implemented it
I'm working with page template in WordPress (don't matter). I'll try insert a picture
I am working with wordpress and I have to display a menu based on
I'm working on wordpress template. On xhtml files I had no problems with jquery,
I'm working on the stylesheet for a wordpress template (http://newwpthemes.com/techzilla-free-wordpress-theme/). I would like the
The following query is not working on the WordPress author.php template for my theme.
I'm working on 108.179.217.161 which is a custom WordPress theme and I have 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.