473,770 Members | 4,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to stretch the background image to fill

I have a pretty simple background image. Just a gradient using two colors.

I like to uses a small image and have the browser stretch it.

Is that possible. I did find the "repeat" but can not find a "stretch"

Is there one?
Thanks
Nov 2 '08 #1
2 17228
On Sun, 02 Nov 2008 16:05:45 +0100, AAaron123 <aa*******@road runner.com>
wrote:
Is that possible. I did find the "repeat" but can not find a "stretch"
CSS does not specify any measures to control the size/strething of
background images. However, you are able to stretch regular images (img
elements), and by playing with the display and z-index attributes you are
able to "fake" a stretched background image.

Example code: http://gist.github.com/21707

--
Joern Schou-Rode
http://malamute.dk/
Nov 2 '08 #2
That works
thanks

"Joern Schou-Rode" <js*@malamute.d kwrote in message
news:op.ujzzxsa 431zpn8@marvin. ..
On Sun, 02 Nov 2008 16:05:45 +0100, AAaron123 <aa*******@road runner.com>
wrote:
>Is that possible. I did find the "repeat" but can not find a "stretch"

CSS does not specify any measures to control the size/strething of
background images. However, you are able to stretch regular images (img
elements), and by playing with the display and z-index attributes you are
able to "fake" a stretched background image.

Example code: http://gist.github.com/21707

--
Joern Schou-Rode
http://malamute.dk/

Nov 3 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
62545
by: TAM | last post by:
Hi, I am using a table with height and width as 100%. I wish to use a background image of size W 62x H 314 pixels for one table cell. How do I make the background image stretch to fit the table cell? I do not want the image to repeat. It should only be a single image stretched as per size of the table. Thanks
3
4980
by: Greg Heilers | last post by:
Hello everyone... If one has a <div> that is completely filled with a background-image; how does one style it so that the image *continues* to fill the <div> top-to-bottom, left-to-right; if the viewer adjusts the font-size on his browser? I have everything sized in em's, so that the actual <div> "box" resizes along with the text, but the background-image will not resize if the text is "zoomed". I can not find anything pertaining
3
9396
by: Sridhar | last post by:
Hi, I have created a user control which has the html code as follows <TABLE id="ToolBarTable" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td align="right" bgColor="#000000"><IMG src="../Images/image1"> </td> </tr> <TR>
2
17005
by: Water Cooler v2 | last post by:
I want to stretch the image so that it fills the entire cell width and height. How do I do that? <TD background="bg.gif" width="100%" height="100%" style="background-repeat: no-repeat;"> So far I have done that but it doesn't seem to work. I think the height and width get applied to the cell instead of the image. Is there a way around this?
6
3456
by: ChrisAtWokingham | last post by:
I am creating a website using .Net v2.0 and c# and I have a problem with background images. I want to dynamically change the background image on the page, depending on data in the SQL database. If I place an <asp> label after the <body> tag, within one of the .NET containers, then it is easy to get the c# code to dynamically change the background image by placing suitable HTML on the label. The problem is that the background image does not...
1
1789
by: drum118 | last post by:
I took a photo 3600x2400 (8mg) into photoshop and reduce it to 250x188 for a background and to load faster, but it only coming up either as a repeat or a small box. I use this: <style type="text/css"> <!-- body { background-image: url ("parklawn1.jpg");
5
3925
by: =?Utf-8?B?S3VsYmVy?= | last post by:
I feel my delay. I had work. First of all, thank you for reply. I explain: I do not know use the code of the original web page in VB.NET. Gillard made the translation from C (and thank you) but some things VB.NET does not recognize them (for example, some "imports"). I do not also know use the part of the code that begins for " <Page ... ", though VB.NET admits this code if in front of every line write three characters of commentary (...
4
5748
by: Bob Altman | last post by:
Hi all, I posted an earlier question to the microsoft.public.inetserver.asp.general newsgroup asking how to set the background of a client-side table cell to a gradient, and I received this answer: How do I stretch the static image? The Style property builder for a table cell lets me specify the background image location, tiling, scrolling, and position. But I can't find any obvious way to tell it to stretch the image
1
3619
by: ravideep | last post by:
I want to stretch the background image of <td> according to the width of td. The width of td can vary becouse of the content inside the td tag. so the background image should be stretched accordingly.
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9869
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.