?
Solved

Position an image on a web page so that it shows up the same on different screen resolutions.

Posted on 2011-03-09
4
Medium Priority
?
330 Views
Last Modified: 2012-05-11
Hi

I have been struggling four a while now trying to learn how to float images on web pages.

I want to float an image so it over laps a little bit of the mainContent div and then run down through the footer. I have been able to use absolute positioning to get the imgae to stick to the bottom but how do I keep it from floating to far to the left or right?

Right now I have it working great on screens set at 1024 * 768 but go to any higher a resolution or use a widescren and it floats off to the left or right.

Site can be viewed here and if there is anything else I can provide just let me know?

http://davidsons.net/wp4derek/

thanks
Matt
0
Comment
Question by:mld4165
  • 2
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 35092493
Typically what we do is create a 'div' that contains all of the content in a fixed width box, often called 'wrap' or 'wrapper'.  Then all of the content stays in that 'wrap' container no matter what size the screen.  Kinda like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!-- 
#wrap {width:940px;margin-left:auto;margin-right:auto;} 
-->
</style>
</head>

<body class="oneColFixCtrHdr">
<div id="wrap">
<!-- beginning of wrap -->

  <div id="header">
  <a href="mailto:Julie@fieldstoneaudio.com?subject=More information requested."> <img id="emailicon" alt="Email Julie at:" height="46" src="images/emaillogo.png" width="46" /></a></div>
<!-- end #header -->

  </div>

	<div id="container">
	<div id="mainContent">
    <div id="redtxt">
		<p>Nearly 15 years ago, I was persuaded to record a radio spot for my restaurant, The Melodeon. The response was overwhelmingly positive, and I’ve been happily doing voiceovers ever since.</p>
	</div>
    	<hr />
			<div id="rightContent">

    		<p style="font-size:large">My client list includes:</p>
			<dl>
            <dt>Lexmark International</dt>
			<dt>Rolex 3 Day Event</dt>
			<dt>Conair Spa Products</dt>
			<dt>University of Kentucky Healthcare</dt>

			<dt>Lexington Clinic</dt>
			<dt>Republic Bank</dt>
			<dt>Milestone Realty</dt>
			<dt>Nationwide Insurance</dt>
			<dt>State Farm Insurance</dt>
			</dl>

    		</div>
	<h1>My voice is the perfect choice for the following:</h1>
	<ul id="ulist">
	<li>Upbeat, high energy and persuasive for retail and automotive.</li>
	<li>Soothing and reassuring for on hold messaging and voicemail systems.</li>
	<li>Warm and compassionate for heath care and physician specialties.</li>
	<li>Interesting and informative for documentaries and narratives.</li>

	<li>Sweet and Southern for regional flavor.</li>
	</ul>
	<hr style="clear:both" />
	<div id="demoicon">
	  <a href="Sound/JulieReedDemo2010.mp3">
      <img id="demoicon" alt="Please click here to listen to my demo:" longdesc="Please click here to listen to my demo:" src="images/demobckgrnd.png" /></a></p>
	  </div>
    <div id="tealtxt">

 <p>My friends locally at Dynamix Audio provide me with state of the art production services; including an ISDN equipped studio with a Neumann U-87 microphone.<br />
  You can visit them here at <a href="http://www.dxaudio.com">www.dxaudio.com</a>.<br />
  Lucky to live in the beautiful Bluegrass area, I am also available to travel to your studio of choice.<br />
  Please contact me, <a href="mailto:&#074;&#117;&#108;&#105;&#101;&#064;&#102;&#105;&#101;&#108;&#100;&#115;&#116;&#111;&#110;&#101;&#097;&#117;&#100;&#105;&#111;&#046;&#099;&#111;&#109;">Julie C. Reed</a> for a prompt, cost effective quote on your next project!</p>

  </div>
  <!-- end #mainContent -->
</div>
<!-- end #container -->
</div>
  <div id="footer">
    <p>Put images and links here.</p>
  <!-- end #footer -->
  <div id="micro">
  <img src="images/microphone.png">

  </div>
  </div>
<!-- end of wrap -->
</div>

</body>
</html>

Open in new window

0
 
LVL 1

Author Comment

by:mld4165
ID: 35099540
DaveBaldwin: thanks so much. I see what i was doing wrong now.
0
 
LVL 1

Author Closing Comment

by:mld4165
ID: 35099542
Thanks for the advice and solution.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35100860
You're welcome, thanks for the points.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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?
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

569 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