floats

Floats messing up in Safari browsers

I have a site I made real fast that uses floats to display different sections of content. The floated content and the content that has an additional margin both appear fine in FF/IE but on safari one of the divs is completely hidden. I've tried switching to padding and position:relative but nothing has worked for me. If I take out the co...

Double and floats in C#

Are you aware what precision of operations on floating point numbers is different in project compiled in debug mode vs the one compiled in release mode. ...

How do you keep parents of floated elements from collapsing?

Although elements like <div>s normally grow to fit their contents, using the float property can cause a startling problem for CSS newbies: if floated elements have non-floated parent elements, the parent will collapse. For example: <div> <div style="float: left;">Div 1</div> <div style="float: left;">Div 2</div> </div> The pa...

CSS floats - how do I keep them on one line?

Hey, I want to have two items on the same line using 'float: left' for the item on the left. I have no problems achieving this alone. The problem is, I want the two items to stay on the same line even when you resize the browser very small. You know... like how it was with tables. The goal is to keep the item on the right from wrapping...

python - decimal place issues with floats

I seem to be losing a lot of precision with floats. For example I need to solve a matrix: 4.0x -2.0y 1.0z =11.0 1.0x +5.0y -3.0z =-6.0 2.0x +2.0y +5.0z =7.0 this is the code i use to import the matrix from a text file: f = open('gauss.dat') lines = f.readlines() f.close() j=0 for line in lines: bits = string.split(line, ',') ...

CSS float and HTML questions

Hello, I have some questions about basic CSS that I was unable to understand or find an answer for. First, I tried placing 3 div tags within another div tag. The first main div tag containing the 3 other tags had nothing set for it except a size, which was 400px by 400px. Of the other 3 divs inside, all were 20px by 20px, and 1 was ass...

When to use a Float

Years ago I learned the hard way about precision problems with floats so I quit using them. However, I still run into code using floats and it make me cringe because I know some of the calculations will be inaccurate. So, when is it appropriate to use a float? EDIT: As info, I don't think that I've come across a program where the accu...

How do you calculate div and mod of floating point numbers?

In Perl, the % operator seems to assume integers. For instance: sub foo { my $n1 = shift; my $n2 = shift; print "perl's mod=" . $n1 % $n2, "\n"; my $res = $n1 / $n2; my $t = int($res); print "my div=$t", "\n"; $res = $res - $t; $res = $res * $n2; print "my mod=" . $res . "\n\n"; } foo( 3044.952963...

How can I use "float: left" in a div without breaking the containing element's height?

It seems that floated HTML elements don't expand the heights of their containers. For example, consider the following code: <div class="portfoliosite" style="background: #777777; padding: 10px; width: 550px;"> <div class="portfoliothumbnail" style="background: red; margin: 0 10px 10px 0; float: left; height: 150px; width: 150px;"><!...

Implementing floating point subtraction

Hello , all I am trying to implement a floating point arithmetic library and I have trouble understanding the algorithm of subtracting floats. I have implemented addition succesfully and I thought that subtraction was just a special case of it but it seems I am making a mistake somewhere. I am adding the code here just for reference, i...

CSS: UL's/OL's vs. Div floating left in IE

The scenario is that the client wants a floating div (the gray box) with text that wraps around it. However some of that text includes ul's and ol's, which hide behind the floating div in IE6. I tried wrapping the ul's/ol's in a div to see if that would help, but have been unsuccessful. Has anyone experienced this problem before and f...

Truncating floats in Python

Basically to remove digits from a float to have a fixed number of digits after the dot, like: 1.923328437452 -> 1.923 EDIT: I need to output as a string to another function, not print. Also I want to ignore the lost digits, not round them. ...

Is it correct that blueprint css allows you to formulate your layout as a grid instead of in terms of floats?

One of the arguments I've heard about blueprint css is that it lets you think of your layout in terms of a grid rather than in terms of floats. This seems like a big advantage to me because I always get confused about where my floats are going to end up - sometimes a float will unexpectedly drop down below some other floats and I have a ...

CSS floats messed up

It doesn't stay where I want it, look at this: <div style="float: left; width: 30%"> <img src="{avatar}" alt="" /> </div> <div style="float:right; width: 70%; text-align: left"> {message} </div> <div style="clear:both"></div> Internet Explorer: Mozilla Firefox: I want the text to be in the top (tried vertical-align: top), and ...

Page not displaying properly until refresh.

On my site, the page displays incorrectly in most browsers until you refresh it. THe website is: http://www.hqinternetsolutions.com/services.html I dont know why it is displaying in this fashion and then it fixes itself on refresh (even without clearing cache) It is a series of divs floated to the left with margin. Any idea? ...

2D-float array values scan

Hi, I wrote a code by using C language as follows: main() { float x[10][10]; int i,j; clrscr(); scanf("%d%d",&i,&j); for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%f",&x[i][j]); ...... } When i run this program, there is an ABNORMAL TERMINATION with the error like 'FLOATING POINT CONVERSIONS NOT LINKED'...

Force all floating DIVs to match the height of their container

Howdy, I'm trying to figure out a way to make three floating divs match the height of the largest floating div of the three (which, via the clearfix solution, is the height of their container). My question is exactly like this question, only my question needs the requirement that the comments to the answer overlook :) ("what if the two...

Is there a library class to represent floating point numbers?

I am writing an application which does a lot of manipulation with decimal numbers (e.g. 57.65). As multiplications and divisions quickly erode their accuracy, I would like to store the numbers in a class which preserves their accuracy after manipulation, rather than rely on float and double. I am talking about something like this: clas...

Formatting jquery-validate's error text

I'm working a .net mvc project using xVal/nHibernate/jQuery-Validate. The aspx is marked up as: <%=Html.Password("Login.Password")%> <%=Html.ValidationMessage("Login.Password")%> and rendered looks like: <input id="Login_Password" class="error" type="text" value="" name="Login.Password"/>metadata={ } <label class="error" for="Login...

Bizarre float bug in IE7

On the webpage I'm working on here, I have a main div, and within the main div, and image div. Roughly speaking, the important HTML is: <div id="wrapper"> <div id="main"> <div class="images"> <p>Content</p> <div class="clear"></div> </div> <p>Text...</p> <div class="clear"></div> </d...