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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:18:58+00:00 2026-06-09T10:18:58+00:00

This is my CSS .test { background-image:url(‘images/smiley.gif’); background-repeat:repeat; } This is my HTML: <div

  • 0

This is my CSS

.test {
  background-image:url('images/smiley.gif');
  background-repeat:repeat;
}

This is my HTML:

<div class="test" id="xyz">some code which should come background to image</div>

The code that I have written sets a background image.

But I want to put an image on top of the text, instead of behind it, so that it covers the text. (I also want it to automatically repeat to fill the element, which could be any size.)

How can I do that?

  • 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-09T10:19:00+00:00Added an answer on June 9, 2026 at 10:19 am

    Interesting task. I think this should do it, if you’re willing to put in an extra HTML element. (Alternatively, use .test:before instead of .test .foregroundImage, like in Georges’ answer).

    HTML

    <div class="test" id="xyz"><span class="foregroundImage"></span>some code which should come background to image</div>
    

    CSS

    .test {
        position: relative;
    }
    
    .test .foregroundImage {
      position: absolute;
      top: 0;
      bottom: 0;
      height: auto;
      left: 0;
      right: 0;
      width: auto;
      background-image:url('images/smiley.gif');
      background-repeat:repeat;
    }
    

    See http://jsfiddle.net/RUJYf/ for a working example.

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

Sidebar

Related Questions

This is my css: .sub-content-border { background-image: url(/images/borders/sub-content/top.gif); background-repeat: repeat-x; background-position: top; } .sub-content-border
I have a css file that links to images. .test{ background: url(http://site.com/dynamic/test.jpg) no-repeat; }
Working live URL showing problem: http://69.24.73.172/demos/newDemo/test.html The HTML : <div class="small-vote"> <a href="#" class="s
I have my current code: #content img[src=/img/test.gif] { background-image:url(dark-img.png) !important; } From my understanding
I have this line of jQuery: $(#colorimage).css('background','url(images/bw.jpg)'); First question: the way that this is
<div> <div>test</div> </div> $(div:contains('test')).css('display','none'); I know I am going to kick myself on this.
This is my markup: <!DOCTYPE HTML> <html> <head> <title>Test title</title> <style type=text/css> * {
I have the following code: <a accesskey=b class=icon icon-foo href=/aa>this is a test</a> CSS
I have got some markup that looks like this: <div class=button> <span class=image></span> <input
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,

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.