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

CSS in Mozilla (Firefox)

I have a div that's defined like so:

<div id="footer">
footer text for web pages
</div>

In the stylesheet is this entry:

#footer {
background-color: #006600;
position: absolute;
top: 410px;
left: 0px;
width: 100%;
z-index: 4;
border: 1px solid #009900;
border-width: 2px 0px 1px 0px;
}

And following the DIV in the HTML file is a Javascript block that
assigns a position for this div, like so:

ftr = document.getElementByPosition("footer")
ftr.style.top = iTop;

where iTop has been calculated earlier in the Javascript. This works
correctly in Internet Explorer. When I put alerts in the script, I see
the page displayed with the footer at 410 pixels (as per the style
sheet), then it jumps to the newly assigned position.

In Mozilla Firefox, the footer never moves. The "calculated style" in
the DOM browser *always* shows the value 410 (from the style sheet),
*never* the assigned value. What's more, trying to display
ftr.style.top results in a blank.

So what's up? It's not a timing issue, when I trigger the Javascript
long after the page loads the result is the same. Is there different
syntax in Mozilla-land for addressing stsyle elements? Or is this a
Mozilla bug? (It does the same thing in NS7)
Jul 23 '05 #1
1 2416
Tim Slattery wrote:
I have a div that's defined like so:

<div id="footer">
footer text for web pages
</div>

[snip]
And following the DIV in the HTML file is a Javascript block that
assigns a position for this div, like so:

ftr = document.getElementByPosition("footer")
ftr.style.top = iTop;

[snip]
In Mozilla Firefox, the footer never moves. The "calculated style" in
the DOM browser *always* shows the value 410 (from the style sheet),
*never* the assigned value. What's more, trying to display
ftr.style.top results in a blank.

One thing that immediately springs to mind is to ask why you have not
used the more sensible statement:-

ftr = document.getElementById ("footer")

What happens if you use that?
Jul 23 '05 #2

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

Similar topics

17
by: autogoor | last post by:
Hi, I am trying firefox and mozilla and found they are not as good as ie in terms of css. For example, here is my css table#maintb{ border : 0px solid; width : 677px; height : 100%; font :...
5
by: Jarson | last post by:
My JavaScript is trying to POST data to a CGI script (Perl) using XMLHttpRequest. My CGI server gets different data from IE than Mozilla Firefox. // For Mozilla, req = new XMLHttpRequest(); //...
0
by: autogoor | last post by:
I want to put a java Applet in a jsp page. Here is what I used: <jsp:plugin type="applet" code="mypackage.myApplet" width="450" height="350" > <jsp:params>...</jsp:params>
4
by: aure_bobo | last post by:
Hi all, I'm currently developping a web app, and this one must be compatible with IE and Mozilla Firefox. In this webapp, I would like to launch automatically a anchor link (href) with a...
0
by: BACON | last post by:
I'm just starting the process of reorganising my modest little website and cleaning up all the HTML, and the logical place to begin was with the homepage. I made a simple little ASP.NET control...
5
by: BACON | last post by:
I'm just starting the process of reorganising my modest little website and cleaning up all the HTML, and the logical place to begin was with the homepage. I made a simple little ASP.NET control...
10
by: News | last post by:
I have a page up trying to learn how to ID a browser and other info. http://wyght.com/warren/testPos.html here is the code <script type = "text/javascript"> var space = ", "; var name...
9
by: Alex D. | last post by:
Hi, I have a frame in one of my pages that I use to show diferent pages each time. I am experiencing an weird behaviour in Mozilla and Firefox, when the frame's source is specified in the server...
8
by: Clément | last post by:
Hi! I am currently developping a user interface with Ajax/C#/.net. And I am facing a problem with Mozilla, and Firefox. I use the function innerHTML to load a Web UserControl into a div, this...
2
by: Gary Hasler | last post by:
I am having various problems with web pages on our site not displaying the result of form submissions properly for users with Mozilla type browsers (eg Firefox, Netscape). After investigation I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.