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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:39:02+00:00 2026-05-26T03:39:02+00:00

i got a p tag which serves as the name label for my image:

  • 0

i got a p tag which serves as the name label for my image:

        string output = "";
        output += "<p id=\"" + container.ContainerID +"\">" + container.ContainerName + "</p>";
        return output;

and i put the background image for the label in css:

 p
 {
    background-position: center;
    text-align: center;
    background-image: url('Add_in_Images/label.png');
    background-repeat: no-repeat;
}

but i face a problem where the text length is not fit with the image, for example, if i have the name large_cabinet_1, the text will run-out from the image.
I am wondering, is there anyway i can set the background image to fit with the text length?? (stretch shorter or longer according to the text)

UPDATE
Hi, i found that it would be easier for me to just use the p tag and set some border and background color to serve as the label. since the tag with automatically expand according to the text inside, the size problem is no longer there. However, since my cupboards images might be very close (just next to) each other, i will have issues where all the label overlapped with each other. I am finding a way (both jquery n css are fine) to cut the text in the label so extra characters should be put to the next line??

Really do need help here.. appreciate any suggestion…

  • 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-26T03:39:03+00:00Added an answer on May 26, 2026 at 3:39 am

    I am finding a way (both jquery n css are fine) to cut the text in the
    label so extra characters should be put to the next line??

    Try word-wrap: break-word.

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

Sidebar

Related Questions

I've got a jquery script, which creates a h3 tag and print a variable
I've got an ASP.Net page in which I have an html anchor tag and
Possible Duplicate: Get image data in Javascript? Hello, I've got a single div, which
I have a span tag which has got rounded circle with the height 30
I am hacking up a tagging application for emacs. I have got a tag
I've got three entities in my application so far: tag, feed and story A
I've got a program that needs to convert two attributes of a particular tag
So I've got our legacy app which is classic asp and I've got a
I want to append a script tag which executes one line of JavaScript to
I've got another problem (which might not be an issue in terms of coding

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.