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
311 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 82

Accepted Solution

by:
Dave Baldwin earned 500 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 82

Expert Comment

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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Change properties of a dialog box 1 22
Phone Dialer 5 38
HTML CSS 7 20
Table changes size when I click edit 7 5
This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now