472,133 Members | 1,054 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

CSS looks different in FF

Hello

I have made a web page which contains styles and templates
Here is a style:
A:link{
color: brown;
}
#template-01 {
position:absolute;
left:0px;
top:0px;
width:760px;
height:212px;
background-image: url(img/template_01.jpg);
}

#template-02 {
position:absolute;
left:0px;
top:212px;
width:202px;
height:69px;
text-align: center;
background-image: url(img/template_02.jpg);
}

#template-03 {
position:absolute;
left:202px;
top:212px;
width:558px;
height:483px;
overflow:auto;
font-family: Monotype Corsiva;
font-size: 18px;
text-align: justify;
background-image: url(img/template_03.jpg);
}

#template-04 {
position:absolute;
left:125px;
top:281px;
width:23px;
height:419px;
background-image: url(img/template_04.jpg);
}

#template-05 {
position:absolute;
left:148px;
top:281px;
width:113px;
height:27px;
background-image: url(img/template_05.jpg);
}

#template-06 {
position:absolute;
left:261px;
top:281px;
width:66px;
height:60px;
background-image: url(img/template_06.jpg);
}

#template-07 {
position:absolute;
left:148px;
top:308px;
width:113px;
height:33px;
background-image: url(img/template_07.jpg);
}

#template-08 {
position:absolute;
left:148px;
top:341px;
width:144px;
height:30px;
background-image: url(img/template_08.jpg);
}

#template-09 {
position:absolute;
left:296px;
top:341px;
width:35px;
height:359px;
background-image: url(img/template_09.jpg);
}

#template-10 {
position:absolute;
left:148px;
top:371px;
width:144px;
height:27px;
background-image: url(img/template_10.jpg);
}

#template-11 {
position:absolute;
left:148px;
top:398px;
width:144px;
height:302px;
background-image: url(img/template_11.jpg);
}
..tytul{
text-align: center;
}
..podtytul{
text-indent: 5%;
margin: 3%;
}
..email{

}
td{
text-align: center;
}
#info{
text-align: left;
}
p{
margin: 3%;
text-indent: 5%;
font-size: 20px;
}
..red{
color: red;
}
img{
border: none;
}

table{
text-align: center;
border: none;
}

and here is a template code:

<?xml version="1.0" encoding="ISO-8859-2"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Pracownia Lamp i Witraży Artystycznych</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"/>
<!-- ImageReady Styles (template.psd) -->
<link href="style.css" rel="stylesheet" type="text/css"/>
<!-- End ImageReady Styles -->
</head>
<body style="background-color:#996600; margin-top: 0px; margin-bottom: 0px;
margin-left: 0px; margin-right: 0px;">
<!-- ImageReady Slices (template.psd) -->
<div id="template-01">
</div>
<div id="template-02">
<table cellspacing="5">
<tr><td><a href="?l=pl"><img src="img/pl.gif" alt=""/></a></td><td><a
href="?l=en" alt=""><img src="img/gb.gif" alt=""/></a></td><td><a
href="?l=de"><img src="img/de.gif" alt=""/></a></td></tr>
</table>

</div>
<div id="template-03">

<p>{$tekst}</p>

</div>
<div id="template-04">

</div>
<div id="template-05">
<a href="glowna.php"><img src="img/template_05{$jezyk}.jpg" width="113"
height="27" alt=""/></a>
</div>
<div id="template-06">

</div>
<div id="template-07">
<a href="oferta.php"><img src="img/template_07{$jezyk}.jpg" width="113"
height="33" alt=""/></a>
</div>
<div id="template-08">
<a href="informacje.php"><img src="img/template_08{$jezyk}.jpg" width="144"
height="30" alt=""/></a>
</div>
<div id="template-09">

</div>
<div id="template-10">
<a href="kontakt.php"><img src="img/template_10{$jezyk}.jpg" width="144"
height="27" alt=""/></a>
</div>
<div id="template-11">

</div>
<!-- End ImageReady Slices -->
</body>
</html>

adress of a site is www.bakula.eu

And the problem:
In IE everything displays OK (excepting one thing) but in FF two images
aren't displayed at all - template-01 and template-03. The div size is equal
to background image sizes. I've also noticed that on my local server (on
linux and windows sytem) everything is ok, this problem is only on a remote
server. Another annoying (the "one thing" shows above) thing is that long
unexpecting horizontal line which only appears on a remote server. I don't
know what to do
Remote server is php 4 on linux machine with php 4.4.x
I have used this kind of programming many times (div and background-images)
many times - without problems
Any suggestions ?
Thank you

Apr 13 '06 #1
6 1825
Michał wrote:
Hello

I have made a web page which contains styles and templates [snap]
adress of a site is www.bakula.eu

And the problem:
In IE everything displays OK (excepting one thing) but in FF two images
aren't displayed at all - template-01 and template-03. The div size is
equal to background image sizes. I've also noticed that on my local
server (on linux and windows sytem) everything is ok, this problem is
only on a remote server. Another annoying (the "one thing" shows above)
thing is that long unexpecting horizontal line which only appears on a
remote server. I don't know what to do
Remote server is php 4 on linux machine with php 4.4.x
I have used this kind of programming many times (div and
background-images) many times - without problems
Any suggestions ?
Thank you


1) Your code does not validate. That's a good starting point for
troubleshooting. For instance a link element cannot be part of any XHTML
page.

2. Things that don work on server #1 but do on server #2 may indicate:
-Improper use of relative/absolute paths in your code
-(Un)availability of required bits of code, images, php snippets etc.
-User rights issues (*nix)
-Different PHP config. Some functions may be disallowed, safe_mode
restrictions, register_globals and the like can make a difference

3. Your code isn very legible. Meaningless div names don´t help me
understand easily what is going on. I always prefer English meaningful
stuff. From first glance it seems it's quite a complicated way of
achieving rather straightforward stuff. Is this auto-generated code by
some program ? The way you set up the "menu" with absolute positioning
doesn't look easy to maintain/change. Why don't you go for an unlinked
list in one div, and use floats to line it all up properly?

4. Try to avoid making your pages for IE first and then fix them for
other browsers. I prefer aiming at FF/Mozilla and then 'repair' for IE
afterwards. IE is the odd one out. also good to start with setting the
default margins and padding to 0, since browsers have different
defaults. * -or- body {margin : 0; padding 0;} is a good first css entry.

5. I see the use of non-common font-family in template-03. Are these 2
fonts or should these be in quotes? It helps having a fallback font like
serif, sans-serif supported by any browser.

6. Do empty divs display in CSS-compliant browsers? I dunno. And the
{$tekst} PHP construct, does it actually expand to real text in your
code ? (same for other vars in the code in your post.

HTH
Sh.
Apr 13 '06 #2
Schraalhans Keukenmeester wrote:
4. Try to avoid making your pages for IE first and then fix them for
other browsers. I prefer aiming at FF/Mozilla and then 'repair' for IE
afterwards. IE is the odd one out.


As a commentary on that:

I found that when I design for IE, and change to fit FF, I have a lot
more work to do than if I design for FF and fix for IE.

So I do exactly as suggested now...
Apr 13 '06 #3
Schraalhans Keukenmeester wrote:

(...)

Thank you very much for your fast and very helpful answer
After very big number of attempts I have recognized that filesizes of my
local jpegs and remote are different exactly in the files that aren't
displaying properly. I don't know what may happened but probably my
computer has hanged on due file transmission. Maybe there is some
misunderstands between Windows ftp clients and Linux operating systems ?
Some time ago I had similar problem - before transmission a flash file
to remote server I had to clear my cache in browser. If no - flash file
didn't display properly. Very strange..
I always check my sites in Firefox at first, but on my local machine
there is no problem - files weren't corupt. IE has displayed these
corupt images without few lines - it was that annoying horizontal brown
line. Firefox hasn't diplayed these images at all. So it was no css
problem but corrupt image problem.
And about strange style of my programming. First - I prepare a template
file in Photoshop, then divide it into slices, save it as jpegs and css
file. After it I make a php mechanism and divides html code and php code
with Smarty - it is the explanation of strange variables in html code.
Can you advice me a better way to prepare pretty and valid websites?

Thank you
Apr 13 '06 #4
Schraalhans Keukenmeester wrote:
For instance a link element cannot be part of any XHTML
page.


Why not?
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Apr 13 '06 #5
On Thu, 13 Apr 2006 17:32:33 +0200, Michał <mi*************@xl.wp.pl>
wrote:
I have made a web page which contains styles and templates Here is a style: <snip css>
and here is a template code: <snip markup>

That was both very unnecessary since you also post this: adress of a site is www.bakula.eu And the problem:
In IE everything displays OK (excepting one thing) but in FF two images
aren't displayed at all - template-01 and template-03. The div size is
equal to background image sizes. I've also noticed that on my local
server (on linux and windows sytem) everything is ok, this problem is
only on a remote server. Another annoying (the "one thing" shows above)
thing is that long unexpecting horizontal line which only appears on a
remote server. I don't know what to do


I think the real problem here might be that you try to position a pixel
perfect design, in addition, a design specifically designed for IE. 'CSS
looks different in FF' should have read 'CSS looks different in IE'. Don't
design for IE. And don't desing pixel perfect.

If you design fluid or liquid using FF and Opera next to eachother for
example, you can be almost certain your design 'works' in many modern
graphical browsers. After that liquid design is created, validate both
markup and css, correct the wrongs and then tweak it with a few simple
hacks (mostly positioning or dimensions or both) for IE (if you start the
selector with [* html] only IE will read the styles; you have to accept
the fact that you have a few mistakes in you stylesheet then).
--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
Apr 13 '06 #6
Michał wrote:
Schraalhans Keukenmeester wrote:

(...)

Thank you very much for your fast and very helpful answer
After very big number of attempts I have recognized that filesizes of my
local jpegs and remote are different exactly in the files that aren't
displaying properly. I don't know what may happened but probably my
computer has hanged on due file transmission. Maybe there is some
misunderstands between Windows ftp clients and Linux operating systems ?
Some time ago I had similar problem - before transmission a flash
file to remote server I had to clear my cache in browser. If no - flash
file didn't display properly. Very strange..
I always check my sites in Firefox at first, but on my local machine
there is no problem - files weren't corupt. IE has displayed these
corupt images without few lines - it was that annoying horizontal brown
line. Firefox hasn't diplayed these images at all. So it was no css
problem but corrupt image problem.
And about strange style of my programming. First - I prepare a
template file in Photoshop, then divide it into slices, save it as jpegs
and css file. After it I make a php mechanism and divides html code and
php code with Smarty - it is the explanation of strange variables in
html code.
Can you advice me a better way to prepare pretty and valid websites?

Thank you

There are plenty good tutorials online on how to get your pages to look
nice and clean. I found this site a good start, The 'Selectutorial'
shows the construction of a simple page step by step, and allows you to
view the result of each step: http://css.maxdesign.com.au/selectutorial/

A useful extension on Firefox is Web Developer. It allows you to see all
kinds of info on your page, and makes it possible to edit your html and
css live! See your pages change while you type!
https://addons.mozilla.org/addon.php?id=60

I generally start with a page in a development environment like Quanta++
(On linux). On Windows I used the simple ConTEXT text editor, no fancy
IDE. (Freeware). I only do the brushing up/corrections in Web Developer/FF

Then I use a freeware utility called Tidy to clean up my HTML so it fits
W3C standards/recommendations. Finally I have the result code validated
by online tools like www.htmlhelp.com/tools/validator/ and
validator.w3.org/

http://www.chami.com/html-kit/ has a free application that allows the
w3c check from within the app.

To be honest, I don't have much faith in HTML/CSS generation by
ImageReady, Photoshop and what have you. I have tried Adobe GoLive! for
a while, but the code it generates is messy, if not flawed. Frontpage is
too much IE-oriented.

So all things considered, I still believe writing your own (x)html is
the way forward. Tidy does most of my code correction and indentation.

Have fun, good luck and you're welcome!
Sh.
Apr 14 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

53 posts views Thread by Paul Rubin | last post: by
8 posts views Thread by G Patel | last post: by
3 posts views Thread by Rachel Suddeth | last post: by
10 posts views Thread by ashkaan57 | last post: by
6 posts views Thread by eransha | last post: by
2 posts views Thread by johnny15 | last post: by

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.