FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

CSS problem - very simple css dont work in Firefox/Opera.

 


D'Artagnan
take de codes below

Code:

//base.css
body{
color:"#navy";
font-size:"13";
}

Code:

<html>
<head>
<title> a cool title here </title>
[i]<link type="text/css" href="base.css" rel="stylesheet">[/i]
</head>

<body>
I'm bill gates friend and will release my pages thus exactly ...
</body>
</html>


this code works only in internet explorer to me =(...
Traveller
  1. CSS comments use "/*" and "*/" instead of "//" so change that first.
  2. Navy is not a hexadecimal number, so it should not have a "#" in front of it.
  3. Navy not a text word, but a substitute for the numeric value specification, so don't enclose it in quotes.
  4. 73 is not a text word, but a numeric value, so don't enclose it in quotes.
When I make all of those changes, it works in both IE and Firefox. If I omit any of those changes, it doesn't work with either of them (for me).

For good reference information, see http://www.w3schools.com/css/css_reference.asp.
D'Artagnan
thanks by ignoring [i] =D... Embarassed

i was using navy without # in the test, the real problem was with " " and bad markup Laughing, this is why ie was displayng...

i thought that is a w3c recommendation to use " " in any value? (or i have drank to much?)

thought - that is correct (#$%@# irregular vebs)...
Traveller
D'Artagnan wrote:
thanks by ignoring [i] =D... Embarassed

i was using navy without # in the test, the real problem was with " " and bad markup Laughing, this is why ie was displayng...

i thought that is a w3c recommendation to use " " in any value? (or i have drank to much?)

thought - that is correct (#$%@# irregular vebs)...

LOL! I had forgotten that I had removed the [i] tags, as well.

I'm not that familiar with the w3c standards, but it could be that the use of the quotation marks was recommended for HTML, but not necessarily for CSS.
Kaneda
D'Artagnan wrote:
i thought that is a w3c recommendation to use " " in any value? (or i have drank to much?)


The XHTML recommendation says to use " " in all attribute values, yes. In CSS, the only place you should use " " is in font names with more than one word, like:

Code:
font: 12px "New Century Schoolbook", Times, "Times New Roman", Times, serif;


For your css to be completely correct (although it already works in current browsers), you should always have a unit attached to any numeric value (except 0, where it's optional - because 0 is 0 no matter if it's 0 pixels, 0 percent, 0 points, 0 inches, 0 ems etc.):

Code:
font-size: 13px; /* Note: no space before unit identifier */
User_f_ps_other
I have rewritten the code here for you here in Xhtml and Css.

The Xhtml Code

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>a cool title here</title>
<link rel="stylesheet" type="text/css" href="main_style.css"/>
</head>

<body>
I'm bill gates friend and will release my pages thus exactly ...
</body>
</html>



The CSS Code

Code:
/* CSS Document */

body{
   color: navy;
   font-size: 13px;
}



Save the Css File as main_style.css and thats it. This will work in any browser out there.
Related topics

Different View CSS Problem with Firefox, opera, IE , mozilla
What do u like in OPERA ?
PHP imagecreate + CSS problem.
PHP imagecreate + CSS problem.
100 days free licence for Kaspersky Internet Security 2009

Paypal ipn instant download
<<<<WEB DESIGNER>>>> for Hire
Changing internal data with scripting.
How do I make websites compatible to all browsers?
List (ul) problem

Slight css problem in IE [SOLVED]
Opera 9.5 & Firefox 3.0 Not working. IE 7 Working. !?Pro
How to center something horizontally AND vertically...
problem with attached css style sheet
Some questions
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.