Solved

Background images that stretch rather than tile

Posted on 2004-04-07
6
80,147 Views
Last Modified: 2011-08-18
Is there any way to have a background image for a TD, TABLE, DIV or SPAN stretch to fill the current size of the object rather than tile?
0
Comment
Question by:elsamman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Expert Comment

by:dynamics407
ID: 10777150
usually all that has to be done is upload the image, taking note of the images dimension ( h x w ) then define the table cell to fit that.

ie. assume that the image is 300 x 250.


<TABLE width="100%" height="100%">
  <TR>
  <TD width="250" height="300" background="image">
  Some text.
  </TD>
  </TR>
</TABLE>
0
 
LVL 2

Expert Comment

by:dgooding
ID: 10777763
I assume you mean that the image is smaller than the td/table/div/span and instead of having a tiled background image, you want a stretched background image?
0
 

Author Comment

by:elsamman
ID: 10778079
Correct.  It is a simple case of a table for a graphical button using text instead of graphics.  The buton is a table with one row and three columns.  The left and right cell have images with width=100% height=100% so they can stretch.  The middle cell has to be a background image because there is the button text in the cell.  The image tiles which is not very nice if you are going for 3D gradient effect.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Accepted Solution

by:
dgooding earned 250 total points
ID: 10778125
0
 

Author Comment

by:elsamman
ID: 10778354
I definitely will not do it the way that is described in that post because I don't want to rely on Javascript being turned on.  None the less I did not think of that and it did not come up in my search. That sort of technique would definitely do the job.
0
 
LVL 2

Expert Comment

by:dgooding
ID: 10778376
Glad I could help....  I think...  :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hta File displays dynamic File names 4 65
output in HTML format powershell 6 51
Expanding/Collapsing Tree on SharePoint List 29 66
Anchor Bookmark 6 34
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question