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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:36:38+00:00 2026-05-11T23:36:38+00:00

I have a 1px wide by 35px high image, that I set as background

  • 0

I have a 1px wide by 35px high image, that I set as background for my h2 elements. The accompanying CSS is as follows:

h2 {
    background:transparent url(./images/h1_bg.gif) repeat-x left top;
    font-size:18px;
}

As a result, the background is set as the image no matter what the length of the heading is, as long as the heading fits in one line. If the heading spills over to next line, then
image is not set as background for the wider area, as it repeats only in x direction. I think I need to create another image, example 1px wide by 60px high image and set it as background of the two-line heading. But I need some way to check if the heading is a two-line heading or not, so I can change the image background. How do I do that? Plus, is there some other way to accomplish this task?

  • 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-11T23:36:39+00:00Added an answer on May 11, 2026 at 11:36 pm

    You can do this by using height.

      if($j("h1").height() > 30)
        {
            $j("h1").css("background","transparent url(./images/h1_bg_0.gif) repeat-x left top")
        }
      else
        {
            $j("h1").css("background","transparent url(./images/h1_bg_1.gif) repeat-x left top")
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div, set to 800px wide, that will automatically scroll horizontally if
I have applied CSS border-bottom:1px dashed #494949; on several consecutive cells of a single
I have this code: $(div[id^='intCell']).mouseover(function() { $(this).css({ border:,1px solid #ff097c}); }).mouseout(function() { $(this).css({border:,1px solid
For example I have a css style like this : input.validation-passed {border: 1px solid
I have an li styled as follows: li{ display:inline-block; padding:5px; border:1px solid none; }
Let say I have, <span class=labels style=background-color: #FFFFFF;border: 1px solid #000000;font-family: Verdana;font-size: 11px; >74.58
For text links, I have: CSS: a:link {color: #3366a9; text-decoration: none} a:hover {border-bottom: 1px
I have a following css #container { border:1px solid black; } #container #header {
I have some extra space around my Listbox. It's 1px wide, but I don't
I have some pretty basic HTML/CSS that isn't working as I expect. Basically I

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.