Click to See Complete Forum and Search --> : [Resolved] css sucks?
ajdegans
03-07-2005, 12:42 PM
Can someone explain why identical CSS code wont work on this one page and it does work on another?
I have this CSS line:
body { background: url('img/bg.jpg') repeat fixed; }
its in a separate CSS file
Now when i use if on www.zerocom.ath.cx it just works
then when i want to use that verysame line in another css file on another site on the same server it work work :(
its weird...
Also ive had more trouble with this kind of css crap. background dont seem to work very well in IE? or is that a common thing? Also i tried firefox but that wont work either :(
can someone enlighten me?
Thanks!
BuzzLY
03-07-2005, 03:11 PM
Is that background image available on that other site? Just because they are on the same server doesn't mean the image is in the same relative path. If it's not working, I would suspect it's not finding the background file.
ajdegans
03-07-2005, 03:28 PM
that is what thought to, but i double checked it. the files are all available...
BuzzLY
03-07-2005, 04:46 PM
perhaps it's because on your site, you refer to the background image as 'images/bg.gif' and not 'img/bg.gif'? It wouldn't be the first time someone made such an error.
ajdegans
03-07-2005, 04:51 PM
nope paths are alright...
Huuggee
03-07-2005, 05:05 PM
i hate to say it, but your paths ARE all wrong
your site is:
http://www.zerocom.ath.cx/
your css is here:
http://www.zerocom.ath.cx/admin/style.css
the style line reads:
body { background: url('images/bg.gif') repeat fixed; }
which means that it is looking for the background image here:
http://www.zerocom.ath.cx/admin/images/bg.gif
that doesn't exist!
but it does here:
http://www.zerocom.ath.cx/images/bg.gif
as you well know.
if you actually look in the source for your page at:
http://www.zerocom.ath.cx/
you will see you have set the bg image in the html code
<body background='images/bg.gif' repeat fixed><!--
> ZeroBlog a Chipmunk Blogger modification!
ajdegans
03-07-2005, 05:19 PM
yes i put it in the html, cuz the css wont work...
im gonna look in the paths again though :) i think youre right ...
keep you posted *blush*
vaaaska
03-07-2005, 05:36 PM
Where ever you put it...what you want is this...
/
body { background: url(/'img/bg.jpg') repeat fixed; }
body { background: url(/'images/bg.jpg') repeat fixed; }
assuming your images folder whatever it is called is just up from the root...
ajdegans
03-07-2005, 05:51 PM
right, well i just checked the paths and played around a bit... i removed the html thingy
<body background...... blabla>
And inserted the body {background: url(../img/bg.jpg) repeat fixed;} in the css
that didnt any work :(
Then i removed the ../ init and now it works for some reason... im not sure what i did different as when i started with it :confused:
i guess im just tired and overlooked somthing here... :bemused:
Anyway, guys, thanks for your input. Its highly appreciated as always!!!
Huuggee
03-07-2005, 07:11 PM
you could always try
body { background: url(../../'images/bg.gif') repeat fixed; }
that definitely will bring you out of the admin directory and should take you to the webserver root. It will then try and go up another level (doesn't hurt to try) and then look for the images directory again.
might just be worth a try
Drakla
03-08-2005, 03:18 AM
This might sound stupid, but isn't the url() feature off css meant to be used without any quotes, so url(images/bg.gif) not url('images/bg.gif')
That might be part of the problem
Weedpacket
03-08-2005, 06:49 AM
Originally posted by ajdegans
... dont seem to work very well in IE? or is that a common thing? Yes, CSS not working very well in IE is a very common thing. IE is famous for it.
ajdegans
03-08-2005, 12:53 PM
drakla:
indeed thats the only thing that changed... but thats fixed now :)
Weedpacket:
Ive read on devshed.com that IE supports CSS kinda bad, and m$ just violates several standards and such ... Also i noticed a lot of html tags are different interpreterd (or whatever its spelled) then, for example, FireFox. I used to write html code which looked perfect on IE then when i opened the very same source on FireFox it was awfull, tables who where all ****ed up and whatnot.
Though. what i wanted to ask then. Is there a browser who supports languages in a descent way? or does every browser have its weird things like i described...
:confused:
Weedpacket
03-08-2005, 03:57 PM
Well, there are standards (www.w3.org), and Firefox (and other Gecko-based browsers) is the browser I'm familiar with that the best job of supporting those standards which fall within its bailiwick (I understand KDE's khtml engine and Opera are right up there as well, but hearing that from me is at second hand at best).
Generally speaking, if it looks one way in IE, and another way in Firefox, it's Firefox that is showing it correctly. If it looks wrong, the bug is in the page, not the browser. (That's not 100% true of course - even Firefox contains bugs - but it's much more likely than the converse.)
More generally, if the browser does something that conflicts with The Standards™, then it's the browser that's wrong. (Otherwise the standards are useless.)
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.