473,657 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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='retur n changeImg(\"" +
nasaPath + link + "_L.jpg\");'>\n " +
"<\/a><br><br>";
document.writel n(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("Apoll o17_Earth");
genImage("clem_ full_moon");
genImage("erosr econstruct_near ");
genImage("giott o_halley");
genImage("lspn_ comet_halley1") ;
genImage("hst_p luto_charon");
genImage("idada ctyl");
</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.leng th == 1)
{ document.writel n("<tr>");}
var data = "<td width='110' valign='top'>" +
"<a href='" + nasaPath + link + "_L.jpg'>\n " +
"<img src='" + nasaPath + link + "_T.jpg'\n" +
"onclick='retur n changeImg(\"" +
nasaPath + link + "_L.jpg\");'>\n " +
"<\/a><br></td>";
document.writel n(data);
if (arguments.leng ht == 1)
{ document.writel n("<\/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("Apoll o17_Earth","fir st");
</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("erosr econstruct_near ");
genImage("giott o_halley");
genImage("lspn_ comet_halley1") ;
genImage("hst_p luto_charon");
genImage("idada ctyl");
</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 2118
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
146590
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 what I wanted. Preferably the varchar would display the number to 2 decimal places but I'd settle for integers only as this conversion isn't business critical and is a nice to have for background information. Casting to MONEY or NUMERIC before...
6
2805
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 the user selects an item on the calendar, the detail can get displayed on the right side there. What I have below appears to look perfect in mozilla based browsers - the detail is aligned at the top right corner of the calendar, but in IE the...
2
9522
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 ? #include <stdio.h> //part09_le01_file_processing_file_setup_ver_01_iti_r01_ch09.c struct name { int int___member1; float float_member2; char char__member3;
6
2456
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 it better: #!/usr/bin/env python num1 = 32 num2 = 42.98765
22
51494
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 next line. What am I doing wrong? TIA.
2
3214
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 is a 5px space between the right and left columns? <div class="calTable"> <div class="calRow">
14
5534
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
2619
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 amount as 2.3841858e-007 instead of 0.00000024
3
599
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 formatting context. So if you do this: body
0
8319
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8837
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.