473,386 Members | 1,726 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,386 software developers and data experts.

float not formatting like table

I created two pages. One using CSS and the other using a table. I'd
like the css version to work like the table version.

The problem arises when the full image doesn't fit in the window.
Click on the moon thumb to see the problem. In IE 5.2 on MacOS
10.2.6, the moon drops down below the list of thumbs. I'd like it to
say to the right of the thumbs and be able to scroll right. In
Netscape 7.2, the larger image of the moon stays to the right of the
thumbs.

I am wondering how I can force the moon to be to the right using CSS.
I tried absolute position a bit, but I had a problem with the footer.
In this case, I do not know the size of the full size picture until I
click on the thumb.

I'd like to move away from using tables.

Robert
css version:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Swap images with CSS formating</title>
<style type="text/css">

#header {
padding: 5px;
border: 1px;
border-style: dotted;
}

#thumbs{
float: left;
width: 15%;
padding-left: 5px;
padding-bottom: 20px;
border: 1px;
border-style: dotted;
}

#picture{
float: right;
width: 81%;
padding-bottom: 20px;
border: 1px;
border-style: dotted;
}

#footer{
clear: both;
background: #eee;
border: 1px;
border-style: dotted;
}

</style>

<script type="text/javascript">
var nasaPath = "http://spaceplace.nasa.gov" +
"/en/educators/images/solarsystem/";

function genImage(link)
{

var data = "<a href='" + nasaPath + link + "_L.jpg'>\n" +
"<img src='" + nasaPath + link + "_T.jpg'\n" +
"onclick='return changeImg(\"" +
nasaPath + link + "_L.jpg\");'>\n" +
"<\/a><br><br>";
document.writeln(data);

}

function changeImg(name)
{
document.images["big_image"].src =
"http://spaceplace.jpl.nasa.gov/en/_images/common/nasa_header/logo_nasa.gif";
document.images["big_image"].src = name;
return false;
}
</script>
</head>
<body>
<div id="header">
<h1 style="text-align: center;">Solar System:</h1>
</div>

<div id="thumbs">
<script type="text/javascript">
genImage("Apollo17_Earth");
genImage("clem_full_moon");
genImage("erosreconstruct_near");
genImage("giotto_halley");
genImage("lspn_comet_halley1");
genImage("hst_pluto_charon");
genImage("idadactyl");
</script>
</div>

<div id="picture">
<img id="big_image"
src=
"http://spaceplace.jpl.nasa.gov/en/_images/common/nasa_header/logo_nasa.gif"
alt="Picture of a solar system object">
</div>
<div id="footer">
<p>These image are from NASA. See:<br>
http://spaceplace.jpl.nasa.gov/en/ed...s_images.shtml
</p>
</div>
</body>
</html>
table version:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Swap images</title>
<style type="text/css">

#footer{
clear: both;
padding-left: 20px;
padding-right: 20px;
padding-top: 5px;
padding-bottom: 5px;
background: #eee;
}

</style>

<script type="text/javascript">
var nasaPath = "http://spaceplace.nasa.gov" +
"/en/educators/images/solarsystem/";

function genImage(link)
{
if (arguments.length == 1)
{ document.writeln("<tr>");}
var data = "<td width='110' valign='top'>" +
"<a href='" + nasaPath + link + "_L.jpg'>\n" +
"<img src='" + nasaPath + link + "_T.jpg'\n" +
"onclick='return changeImg(\"" +
nasaPath + link + "_L.jpg\");'>\n" +
"<\/a><br></td>";
document.writeln(data);
if (arguments.lenght == 1)
{ document.writeln("<\/tr>");}
}

function changeImg(name)
{
document.images["big_image"].src =
"http://spaceplace.jpl.nasa.gov/en/_images/common/nasa_header/logo_nasa.gif";
document.images["big_image"].src = name;
return false;
}
</script>
</head>
<body>
<h1 style="text-align: center;">Solar System</h1>
<table>
<tr>
<script type="text/javascript">
genImage("Apollo17_Earth","first");
</script>
<td width="600" height="800" align="center" valign="top" rowspan="7">
<img id="big_image"
src=
"http://spaceplace.jpl.nasa.gov/en/_images/common/nasa_header/logo_nasa.gif";

</td>
</tr>

<script type="text/javascript">
genImage("clem_full_moon");
genImage("erosreconstruct_near");
genImage("giotto_halley");
genImage("lspn_comet_halley1");
genImage("hst_pluto_charon");
genImage("idadactyl");
</script>
</table>
<div id="footer">
<p>These image are from NASA. See:<br>
http://spaceplace.jpl.nasa.gov/en/ed...s_images.shtml
</p>
</div>
</body>
</html>
Jul 20 '05 #1
1 2103
rc*******@my-deja.com (Robert) wrote:
css version:


Don't post code to the group, post urls instead.

Better yet: post a minimised test case:
http://www.spartanicus.utvinternet.i...s_help_you.htm

Mention in advance if the examples require javascript to be enabled,
some of us refuse to enable it.

--
Spartanicus
Jul 20 '05 #2

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

Similar topics

3
by: David Sharp | last post by:
I'm trying to find a way to format a FLOAT variable into a varchar in SQL Server 2000 but using CAST/CONVERT I can only get scientific notation i.e. 1e+006 instead of 1000000 which isn't really...
6
by: TJ | last post by:
I've got a calendar that is based on the concept of lots of blocks that are spans with float:left. I would like to be able to have a detail section on the right side of the screen, so that when...
2
by: hpy_awad | last post by:
formatting float variables to fprintf has error to my writing to output file called rental and I do not the reason that a rabish is written to the file instead of the actual input screen values ? ...
6
by: Brian | last post by:
Hello all, I am a bit stuck with a float formatting issue. What I want to do is print a float to the screen with each line showing one more decimal place. Here is a code snip that may explain...
22
by: ashkaan57 | last post by:
Hi, I am trying to put text on left and right side of the page and used: <div> <span>blah blah</span> <span style="float:right">blah blah</span> </div> The 2nd text does go to the right but the...
2
by: pbd22 | last post by:
Hi. I am learning my way around formatting DIVs and am stuck. Can somebody tell me how to format the below so the left column is, say, 30% wide and the right column is the remainder. And, there...
14
by: Jim Langston | last post by:
The output of the following program is: 1.#INF 1 But: 1.#INF 1.#INF was expected and desired. How can I read a value of infinity from a stream?
5
by: Selvam | last post by:
Hi All, I am getting exponent value when doing float arithmetic in C++. Instead of that I need accurate value. float amount = 0.0f; float x = 0.99999976f; amount= 1.0f - x; I am getting...
3
by: Ben C | last post by:
On 2008-04-07, Gus Richter <gusrichter@netscape.netwrote: No the containing block for a float is always above it in the document tree. But floats "invade" subsequent blocks in the same block...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.