maim9
02-19-2008, 07:38 PM
Hello,
Thank you for a good forum. I have tried to search, but I can't seem to find any answer to the problem I've encountered. What I'm basically trying to do, is to make the css-file determine all body-properties of my html-documents, but for some reason, this is not working.
I'm sure I must have missed something, but I can't seem to figure out what.
These are the first few lines of the css-file ("stilark.css"):
html { margin: 0;
padding: 0;
}
body {
text-align: center;
background: #000000;
background-image: url(/Grafikk/BGgradient.jpg) repeat-y top left;
}
P { font-family: Verdana, Arial, Sans-serif; font-size: 11px; font-weight: 400; color: #969696; background: transparent; }
A:link { font-weight: 400; font-style: normal; text-decoration: none; text-transform: none; font-variant: normal; color: #C0C0C0; }
A:visited { font-weight: 400; font-style: normal; text-decoration: none; text-transform: none; font-variant: normal; }
A:hover { font-weight: 500; font-style: normal; text-decoration: underline; text-transform: none; font-variant: small-caps; color: #FFFFFF; }
And this is my html file with the body content left out. Sorry I can't give you a "live" example, but I haven't published the page yet.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>(tittel)</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="description" content="name" />
<meta name="keywords" content="name" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<style type="text/css"></style>
<link rel="stylesheet" type="text/css" href="elementer/stilark.css" />
</head>
<body bgcolor="#000000" text="#969696" link="#C0C0C0" vlink="#969696" alink="#C0C0C0">
...
</body>
</html>
What happens is that none of the properties applied to the body through the css file display. In this example, it means that the background image doesn't display. The colors display since I include them in the body-tag. Leaving them out, makes a white background, even if colors as well are included in the css.
I'm confused. I've gone through both files word by word and matched them with other functioning pages, but I can't find out what's wrong.
Any help is very much appreciated!
Edit: What's weird and interesting is that the "text-align" property works. All other tags are read and effected by the html-file as well. It's only body-properties related to colors and fonts that I can't make work.. I've tried **any** kind of syntax I can think of (all values in one "background"-line, or a separate "background-image", etc..)
Thank you for a good forum. I have tried to search, but I can't seem to find any answer to the problem I've encountered. What I'm basically trying to do, is to make the css-file determine all body-properties of my html-documents, but for some reason, this is not working.
I'm sure I must have missed something, but I can't seem to figure out what.
These are the first few lines of the css-file ("stilark.css"):
html { margin: 0;
padding: 0;
}
body {
text-align: center;
background: #000000;
background-image: url(/Grafikk/BGgradient.jpg) repeat-y top left;
}
P { font-family: Verdana, Arial, Sans-serif; font-size: 11px; font-weight: 400; color: #969696; background: transparent; }
A:link { font-weight: 400; font-style: normal; text-decoration: none; text-transform: none; font-variant: normal; color: #C0C0C0; }
A:visited { font-weight: 400; font-style: normal; text-decoration: none; text-transform: none; font-variant: normal; }
A:hover { font-weight: 500; font-style: normal; text-decoration: underline; text-transform: none; font-variant: small-caps; color: #FFFFFF; }
And this is my html file with the body content left out. Sorry I can't give you a "live" example, but I haven't published the page yet.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>(tittel)</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="description" content="name" />
<meta name="keywords" content="name" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<style type="text/css"></style>
<link rel="stylesheet" type="text/css" href="elementer/stilark.css" />
</head>
<body bgcolor="#000000" text="#969696" link="#C0C0C0" vlink="#969696" alink="#C0C0C0">
...
</body>
</html>
What happens is that none of the properties applied to the body through the css file display. In this example, it means that the background image doesn't display. The colors display since I include them in the body-tag. Leaving them out, makes a white background, even if colors as well are included in the css.
I'm confused. I've gone through both files word by word and matched them with other functioning pages, but I can't find out what's wrong.
Any help is very much appreciated!
Edit: What's weird and interesting is that the "text-align" property works. All other tags are read and effected by the html-file as well. It's only body-properties related to colors and fonts that I can't make work.. I've tried **any** kind of syntax I can think of (all values in one "background"-line, or a separate "background-image", etc..)