473,320 Members | 2,000 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Image tag with CSS background attribute

18
Hi, I've got an Image (a transparent png) over a background (a jpeg).
I'd like them to stretch toghether.
I've tried:
<img src="MyImage.png" alt"foreground image" width"100%" height"100%"
style"
background-image: url(MyBackground.jpeg);
background-repeat: no-repeat;
background-size: 100%;" />

Doing so I can correctly see the png over the jpeg, but when I resize the window I got the png stretched while the background jpeg doesn't move.
Why doesn't it work?
Feb 5 '08 #1
1 1363
Death Slaught
1,137 1GB
Your background image won't stretch because it is 'part' of the page itself so to speak. It can't be resized because you would have to increase the size of the browser itself (which isn't possible).

You can put two images in the same 'container' and give one of them a z-index

^_^ Thanks, Death
Feb 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: MediaDesign | last post by:
so there's the problem: my text links have background images and when I put links around images on my page, they too get the background image treatment which I do not...I have tried several...
5
by: Derek Fountain | last post by:
I have a horizontal navigation bar, which is a single row table containing the right images. It "stretches" itself across the screen using a penultimate td like this: <td width="100%"...
5
by: Doug Laidlaw | last post by:
HTML validators say that "background" is not a valid attribute for a <td> tag I want to set an image as the background for one cell only, and to have the cell content on top of it. If I can't...
7
by: Nilesh | last post by:
I am using background-image attribute in a CSS file and linking the CSS file to aspx page. But strangly, background-image attribute is not working for relative URL. e.g. If I apply following css...
7
by: roN | last post by:
Hi, I have an image and I would like to draw a border around it, I tried: <p style="border:1px border-style:solid; border-color:#EEEEEE; background-color:#FFFFFF;"><img src="./images/header.jpg"...
5
by: Michael | last post by:
Is there a way to specify a background-image for a html table cell in a theme's css file. I know a lot of things I can't do... can't figure out one that I can do: 1) ~/ Images/logo.gif...
6
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to...
8
by: John | last post by:
Hi Pasrt of HTML - <div class='button'><input type='image' src='/images/check1.jpg'></input></div> Part of CSS - ..button {background-image: url(/images/check1.jpg); background-repeat:
9
by: Cartoper | last post by:
I want to move the image for a link from the HTML to the CSS, but cannot figure out how to do it. Here is the old HTML: <a href="somewhere.html"><img src="anImage.gif"/></a> The image is 18x48
4
by: GArlington | last post by:
I am trying to implement an image map (in this particular case a country map) with few <area ...>s on it. The challenge is to add background image (dot) to each <areaso it will display over the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.