View Full Version : Browser defined background color?
Chris P. Bacon
01-26-2007, 04:39 PM
Hi,
Is it possible to make the background color change, if a user got a certain browser? Like, an IE user get #131313, a Firefox user get #FFFFFF.
Im asking because for some reason, IE shows a darker color than the one i designed my site with... This shows the outline of my design in IE. I gave my entire website #131313 as bg color in Photoshop, and as my bgcolor on the site, but IE shows the designpart, as a darker color.
Any help would be greatly appreciated! :)
jscheuer1
01-26-2007, 05:30 PM
If you are using a stylesheet to set these colors, it is fairly easy. Are you?
However, there is no real good reason I can think of why this should be the case (though there might be some browser bug or quirk causing it) so, the better question would be, "Why is this even happening and how can I stop it?"
Even if it is a quirk, perhaps just forcing the browser out of quirks mode would fix it. The best method, if possible, would be to stop it from happening, rather than add to code to change things for certain browsers.
Can you supply a link to your page?
I gave my entire website #131313 as bg color in PhotoshopHm? How? Photoshop is an image-editing suite.
Chris P. Bacon
01-26-2007, 05:54 PM
Hm? How? Photoshop is an image-editing suite.
Yup, but I made my design in Photoshop, and then cut it up in pieces. It is the background color on these pieces, that get darker in IE, but its the exact same color i put as background color in my code. This also works perfect in Firefox, but not in IE.
jscheuer1 - It is a portfolio site, so its very fast to load, and got a low amount of code. Some extra strings to make sure this dont happen, would not be a problem.
I have tested it on several computers, its the same prob. I would be very happy for some code to fix it. :)
jscheuer1
01-26-2007, 05:58 PM
If you are using a stylesheet to set these colors, it is fairly easy. Are you?
Are you?
Chris P. Bacon
01-26-2007, 06:00 PM
Are you?
Oops sorry, yes I am. :o
Yup, but I made my design in Photoshop, and then cut it up in pieces.That's a very bad way to design a site. Nevertheless, what image format are you using?
Chris P. Bacon
01-26-2007, 06:02 PM
This shows the problem:
Firefox: http://img167.imageshack.us/img167/9914/firefoxversionuj0.jpg
IE: http://img403.imageshack.us/img403/7016/ieversionms6.jpg Notice the change in color, at each side.
Chris P. Bacon
01-26-2007, 06:04 PM
That's a very bad way to design a site. Nevertheless, what image format are you using?
Why is it bad? In this case, I only got 3 main graphics; a top, content, and bottom. They are .png files.
As I suspected -- gamma correction. Don't save gamma information with the file. You can read more about the problem of gamma correction here (http://hsivonen.iki.fi/png-gamma/).
Why is it bad?It doesn't allow text to be resized, and makes for a fixed-width site that looks bad in resolutions other than those for which it was designed.
Chris P. Bacon
01-26-2007, 06:43 PM
As I suspected -- gamma correction. Don't save gamma information with the file. You can read more about the problem of gamma correction here (http://hsivonen.iki.fi/png-gamma/).It doesn't allow text to be resized, and makes for a fixed-width site that looks bad in resolutions other than those for which it was designed.
I see the point, but (after visiting your site, I dont like to say this. :rolleyes: ) my site is built with tables, with a dynamic width that makes the site "fit" on lower and higher resolutions. I got no textgraphics on the site, just pure text.
Thank you for the gamma correction link! I'll look into it. And also thanks to both of you, for helping out a beginner like me. I'll remember your tips for the future. :)
jscheuer1
01-26-2007, 06:57 PM
I can't tell the difference between the two images except that the position of things appears to move.
Anyways, if Twey's idea about gamma correction doesn't fix things, the way to have different style settings for IE is via conditional comments. Below the entry in the head where your stylesheet or stylesheet link is, put this:
<!--[if IE]>
<style type="text/css">
/*ie only style*/
body {
background-color:white;
}
</style>
<![endif]-->
or:
<!--[if IE]>
<link rel="stylesheet" href="ie_hacks.css" type="text/css">
<![endif]-->
for an external stylesheet called 'ie_hacks.css' of IE specific styles.
Note: IE 7 is getting many things 'right' that previous IE versions did not so, you might need to use:
<!--[if lt IE 7]>
in place of:
<!--[if IE]>
Chris P. Bacon
01-26-2007, 09:18 PM
Just for everyones notice, I found a very easy way to fix the gamma problem.
Simply go here: http://blog.reindel.com/2006/12/29/remove-the-gamma-gama-chunk-from-a-png-image-to-fix-darker-colors-in-ie/
Get the program from the site, remove the gamma from the png, and its fixed! Again, thanks for your help, guys! :D
In the GIMP (http://www.gimp.org/), it's possible just to untick "save gamma" when saving the image. I'm sure there must be some way to do it in Photoshop.
Chris P. Bacon
01-28-2007, 04:21 PM
ANOTHER QUESTION:
Instead of making so many threads, I might just ask another question here.
Im looking for a clean, simple guestbook. It have to be PHP only, no mysql. I cant really seem to find what I want. Though I HAVE found a guestbook that is exactly how I want it. Like on this page (you might not understand the language) http://zule.dk/v5/gaestebog.php.
Anyone know where to find a similar?
BLiZZaRD
01-28-2007, 04:35 PM
Try BellaBooks (http://www.jemjabella.co.uk/scripts/bellabook.php)
Or if that doesn't suit you try google. What you are looking for is called a "flat file" guest book. Flat file means no database, and all entries are written to an actual file, which is probably going to be named something like "entries.txt" or the like.
Here is a generic Google search (http://www.google.com/search?hl=en&q=php+flat+file+guestbook&btnG=Google+Search) to get you started :D
Chris P. Bacon
01-28-2007, 05:35 PM
Thanks for the links! Sadly, I havent found any that I like, yet. What I want most importantly is, that the form that you need to fill, and the posted messages are on the same site, like they are on the link I posted.
I dont want a Sign Guestbook link, that take me to one page, and after I posted, I get to a second page. I will keep looking, but any help would be great! :)
BLiZZaRD
01-28-2007, 05:39 PM
Without a database you are severely limiting yourself. Is there a reason you don't want to use a DB for this?
Be aware that databases like SQLite (http://www.sqlite.org/) exist that allow one to store a database in a simple file, with no need for a separate server.
Chris P. Bacon
01-28-2007, 05:50 PM
Without a database you are severely limiting yourself. Is there a reason you don't want to use a DB for this?
Hmm, I just checked my webhost... Appearently I got PHP with mysql database... As I can see, I have to contact them to set it up. I dont know anything about it. I guess I can use database guestbooks afterall. :D
BLiZZaRD
01-28-2007, 06:22 PM
Thats great, as there are some really good ones out there.
Find the one you like, most come with an auto installer type page, where you will go to the install.php in your browser, fill in the DataBase information and it will make all your tables and things for you. You don't have to worry much about that end of it at least.
And as always if you need help you can always ask here :D
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.