473,386 Members | 1,785 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.

Is there a CSS absolute positioning rendering bug in FF1.02 and IE 6?

Is there a CSS absolute positioning rendering bug in FF1.02 and IE 6?

I have been experimenting with precision absolute positioning in CSS.

The following test content was used in the experiment:
"This sentence is to be about nine words long. I hope this test suite
works. Mary had a little lamb and its fleece was white as snow."

Next a macro was used to divide the content into equal sentence
fragment spans of the 12 characters each and placed in a html page
linked to a external stylesheet called frag1.css. This yielded the
following results:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<TITLE>sentence frag tester</TITLE>
<link rel="STYLESHEET" type="text/css" href="frag1.css" />
</head>
<p>
<span class="pf1">This sentenc</span>
<span class="pf2">e is to be a</span>
<span class="pf3">bout nine wo</span>
<span class="pf4">rds long. I </span>
<span class="pf5">hope this te</span>
<span class="pf6">st suite wor</span>
<span class="pf7">ks. Mary had</span>
<span class="pf8"> a little la</span>
<span class="pf9">mb and its f</span>
<span class="pf10">leece was wh</span>
<span class="pf11">ite as snow.</span>
</p>
</html>

Notice that some of the spans divide a word and some spans contain a
leading space like the span class "pf8".

Next the style sheet "frag1.css" contained the following :
*{font-family: courier; font-size: 1em;}
p{position: relative;}
..pf1{position: absolute; top: 0em; left: 0em; background-color: yellow;
}
..pf2{position: absolute; top: 0em; left: 7.5em; background-color:
orange;}
..pf3{position: absolute; top: 0em; left: 15em; background-color:
yellow;}
..pf4{position: absolute; top: 0em; left: 22.5em; background-color:
orange;}
..pf5{position: absolute; top: 1em; left: 0em; background-color:
yellow;}
..pf6{position: absolute; top: 1em; left: 7.5em; background-color:
orange;}
..pf7{position: absolute; top: 1em; left: 15em; background-color:
yellow;}
..pf8{position: absolute; top: 1em; left: 22.5em; background-color:
orange;}
..pf9{position: absolute; top: 2em; left: 0em; background-color:
yellow;}
..pf10{position: absolute; top: 2em; left: 7.5em; background-color:
orange;}
..pf11{position: absolute; top: 2em; left: 15em; background-color:
yellow;}
The problem I am having is that when a span begins with a space, as is
the case with class .pf8 from the html code, it is ignored and
compressed directly into the preceding span. For example the following:
<span class="pf7">ks. Mary had</span>
<span class="pf8"> a little la</span>

should display in FF as "ks. Mary had a little la" with a space between
"had" and "a" since a space precedes the word "a" in span class "pf8".
Instead this is what is displayed in my browser: "ks. Mary hada little
la" where the word "had" and "a" are compacted into "hada" . The space
that precedes "a" is completely ignored even though it appears in the
pf8 span in the html code.

Is this a bug? I am I doing something wrong? How can I make it work so
that leading spaces appearing inside a span are not ignored?

Jun 28 '06 #1
3 2208
Els
ho*******@yahoo.com wrote:
How can I make it work so that leading spaces appearing inside a span are not ignored?


Use &nbsp; instead of just a space.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Jun 28 '06 #2

"Els" <el*********@tiscali.nlwrote in message
news:zu*****************************@40tude.net...
ho*******@yahoo.com wrote:
Use &nbsp; instead of just a space.
Simpler:

span { white-space: pre }

Dave
Jul 6 '06 #3
Els
Dave wrote:
"Els" <el*********@tiscali.nlwrote in message
news:zu*****************************@40tude.net...
>ho*******@yahoo.com wrote:
Use &nbsp; instead of just a space.

Simpler:

span { white-space: pre }
Doesn't work in IE.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Jul 6 '06 #4

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

Similar topics

4
by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I...
7
by: Griff Miller | last post by:
Please see http://home.houston.rr.com/gmiller15/css/vertprob.html . In mozilla 1.6/1.7 it looks the way I want it, with a thin separation between the two boxes. In IE6, the two boxes touch, which...
6
by: Gustaf Liljegren | last post by:
Here's what I'm trying to achieve: 1. A <div>, centered on screen, 600px wide and 100px high, with a background-image (also 600 x 100). 2. Text (an <h1> element) positioned with precision inside...
4
by: wls | last post by:
I've got a problem that requires rendering DIVs at different offset locations, and while I've got a solution that works, the absolute positioning is working to the client window, not to the parent...
4
by: mike eli | last post by:
Hi, I have several absolute positioned elements inside an absolute positioned DIV. I would like one of the nested elements to have a dynamic width. I set it's left and right attributes to 5, so...
4
by: Alan Silver | last post by:
Hello, Having been a light reader of this ng for a few months now (after several years absence), I have noticed that absolute positioning seems to be considered a Very Bad Thing around here....
6
by: Mark | last post by:
hi, i'm trying to position something in the top right corner of a container, but i can't seem to figure out how to get it working. here's the html <div class='thumb'><a href='image.jpg'><img...
1
by: alice | last post by:
Can someone point me to a page that has good info on how the different browsers handle positioning? I'm finding that position:absolute works differently between Safari and IE7. Sort of ironic if...
20
by: mehstg1319 | last post by:
Hi there Not sure if anyone can help me, I am working on a site for my university, and am having a bit of trouble with css positioning. I am very new to css and do not know very much about it....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.