473,668 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>senten ce frag tester</TITLE>
<link rel="STYLESHEET " type="text/css" href="frag1.css " />
</head>
<p>
<span class="pf1">Thi s sentenc</span>
<span class="pf2">e is to be a</span>
<span class="pf3">bou t nine wo</span>
<span class="pf4">rds long. I </span>
<span class="pf5">hop e 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">le ece was wh</span>
<span class="pf11">it e 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 2226
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*********@ti scali.nlwrote in message
news:zu******** *************** ******@40tude.n et...
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*********@ti scali.nlwrote in message
news:zu******** *************** ******@40tude.n et...
>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
11005
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 scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like to have it be that they would stay in the same relative position. I want to keep the image as an...
7
6295
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 is not what I want. Is there a way to get IE6 to do it the mozilla way? Thanks! Griff
6
2666
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 the <div>, on the image. 3. A similar result in IE and FF... Here's some of the XHTML:
4
25829
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 container. The stuff I write will get placed inside a table cell produce by someone else's template -- I have no control other than to emit HTML/CSS within that sole cell. So, I decided to construct a simple case and am having problems...
4
4573
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 the the element should have a width = parentWidth - 10; This is the desired behaviour, but it won't work. I still have to specify a width or the element has a width of 0. Setting the width to '100%' doesn't give me the desired effect; it takes...
4
2103
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. Generally, when someone posts a question about a design that uses it, they are told not to. Now, in my ignorance, I don't see what's wrong with it, when used sensibly. Let me say straight off that I am *not* talking about trying to produce...
6
2915
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 src='photos/thumbs/ bigsmile.jpg'></a><a class='del' href='?p=gallery&del=2'>x</a></div> where 'thumb' is my container, and 'del' should be aligned to the top right. here's the css
1
2534
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 you ask me. I can't seem to easily find anything on the web about how to handle this. Is there some sort of hack for IE?
20
2809
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. Here is the link: http://homepages.feis.herts.ac.uk/~bp6ar/bus_intel/matrix/matrix.html Basically, the problem is that the ticks on the grid look perfectly
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
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
8799
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...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
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
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
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
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.