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
Solved

Picture resizing with browser

Posted on 2007-04-06
4
133 Views
Last Modified: 2010-04-09
All I want to do is make it so that this picture is the as big as the browser.  No bigger and no smaller.  When the user shrinks the browser the picture should shrink.  Here is my code:  

<body bgcolor="#c0c0c0" style="margin:0px;">
<img src="images/beach-pictures.jpg" align="middle" width="100%" height="100%" />
</body>

It works perfectly when I view it with my Mac, but when its viewed on a PC it picture is larger than the screen so the user has to scroll down.  Then if the user shrinks his browser the picture stays the same size and does not shrink with the browser.  

All I want to do is create a page with one picture and nothing else.  No borders, no text, nothing else.  Please help.  I know this is easy but i need this to work asap.  THanks again.
0
Comment
Question by:trifecta2k
  • 2
  • 2
4 Comments
 
LVL 30

Expert Comment

by:Steggs
ID: 18867810
Hello trifecta2k,

Try this;

<html>
<head>
* {padding:0;margin:0;}
html, body, img {height:100%;width:100%;}
</head>
<body>
<img src="images/beach-pictures.jpg" />
</body>
</html>
Regards,

Steggs
0
 
LVL 5

Author Comment

by:trifecta2k
ID: 18867851
I'm getting a syntax error.  Everything you have in the <head> shows up as text in IE.
0
 
LVL 30

Accepted Solution

by:
Steggs earned 500 total points
ID: 18867899
OOPS!

Try this

<html>
<head>
<style type="text/css">
* {padding:0;margin:0;}
html, body, img {height:100%;width:100%;}
</style>
</head>
<body>
<img src="images/beach-pictures.jpg" />
</body>
</html>
0
 
LVL 5

Author Comment

by:trifecta2k
ID: 18867906
Thanks.  It works great!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to hyperlink a document in MS Word w/o full path 1 35
Else condition 9 23
Hide cell in a table 2 27
AJAX Wordpress Not Reading Variable 2 27
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

839 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