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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:58:15+00:00 2026-05-26T04:58:15+00:00

I am trying to apply a background-image to a li element. <ul> <li class=maintablink>&nbsp;</li>

  • 0

I am trying to apply a background-image to a li element.

<ul>
<li class="maintablink">&nbsp;</li>
</ul>

My CSS for the same is

li.maintablink{background:url(../images/tab_content.png) no-repeat left top;}

Even adding some width:200px;height:200px above does not work.

I am using HTML5 doctype

I have 2 questions related to this;

  1. The background image is slightly bigger and does not display fully inside the li. i.e. it indirectly depends on the content inside my li element. I do not want to give any content inside li (except &nbsp;)
    How do I fix this issue ?

  2. I am using fluid layout (everything in %, no px value)…So how do I give the width/height for this background-image…It should scale with the browser size (I know for page images, we use img{max-width:100%})…But how do I make background-images scalable ?

  • 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-26T04:58:16+00:00Added an answer on May 26, 2026 at 4:58 am

    It sounds like you’re looking for the CSS background-size property.

    For a background that is scalable according to the size of the container:

    background-size: auto;
    

    For a background that is a fixed size, regardless of the size of the container or the actual background image:

    background-size: 150px 200px;
    

    You can also use percentages, or the keywords contain or cover.

    See http://www.css3.info/preview/background-size/ for more info.

    Please note that background-size does have quite good browser support now, but some older browsers (in particular IE8 and earlier, but also Firefox 3.x) do not support it.

    If you need to support these browsers fully, you will need to work out a fall-back solution (probably using additional markup and/or Modernizr to determine whether the feature is available).

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

Sidebar

Related Questions

I'm trying to apply background image (same one) to two div tags: .abc {
I am trying to apply css on the first A element inside .Outer, .Outer
I have an element on a page with background image set using css: //
I'm trying to apply a CSS image rollover on a Wordpress header logo. I
I am trying apply two background images for an entire table row. One background
I am trying to apply a background image hover effect on each row in
I am using CSS to apply a background image to a div tag that
I am trying to apply a background image for a button inside the form.
Im trying to apply different background color to even and odd items in a
I'm trying to apply a custom RGB color to background, but it is not

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.