Forum Moderators: not2easy
Here is what I currently have;
body {
font-family: comic sans ms, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
leftmargin:20%;
topmargin:0%;
marginwidth:0%;
marginheight:0%;
}
Any thoughts?
Thanks,
body {
font-family: comic sans ms, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
margin-left:20%;
margin-top:0%;
}
You need not specify <body class="body">, the style rule defines the body properties, so using just <body> is fine.
Important: leftmargin, topmargin, marginwidth and marginheight are not CSS properties and are therefore ignored by browsers. As far as I know, they used to be proprietary HTML tags that Netscape introduced in the dark ages of the internet and should not be used any more. You can read up about the different ways of correctly using margins in CSS at [w3.org...]
[edited by: zendak at 3:17 pm (utc) on Feb. 6, 2004]
Also, multiple word font names need to be enclosed in quotes
Nieither does font size work, but color does work. Any ideas?
<font size="3">Text</font> b) Make sure you didn't declare the font attributes twice in your css, as identical rules will override each other, namely always the last one given will make the previous ones useless.
c) Browser could be configured to show a fixed text size.. Which one(s) are you using?
Another thing: if a value equals zero, no unit needs to be given, i.e.
margin-left: 0;
has the same result as
margin-left: 0%;
Omitting that per cent sign has already reduced your document size by one byte ;)
When possible, use shorthand properties as aevea demonstrated, they'll save some space, too.
body {
font: 12px "Comic Sans MS", Helvetica, sans-serif;
color: #000;
margin: 0 0 0 20%;
}
What browsers are you testing on? Are you sure that Comic Sans and/or Helvetica are both installed on your test machines?
I don't have other body fonts but I do have font-family for lists, headers, etc
Do they all have to be the same, in this case the font face is the same but the font size will varry. Is that an issue?
Example:
body {font: 12px Arial, sans-serif; color: green}
h1 {font: 14px;}
li {font: Verdana, sans-serif;}
td {font: 10px; color: red;}
will result in:
Level 1 headers = 14px Arial green
List items = 12px Verdana green
Table cell content = 10px Arial red
As you can see, you only really need to specify those properties that differ from the parent element's. In my example I did not specify the font face and colour for h1 again, as it inherits the values from the body. Only the size is different, so that was specified. Etc.
Go through your CSS and HTML with that in mind. If you can't find the problem, maybe post a link to your page or post more complete HTML and CSS.
Hope it helps :)
No, shouldn't be a problem to just use the body selector for the margins if you define your fonts etc for the table.
I should mention that Netscape 4 ignores what you defined in body for td. As an example you should use
body, td {font: 16px Helvetica; color: #000; background-color: #fff;}
instead of just
body { ... }
Otherwise NN4 will use the browser defaults for your table which will look pretty ugly in your design.
PS: Going into another topic, you should also make sure that you really need tables for what you're doing. If you're new to using tableless layouts I recommend researching it as it has many advantages for both you as a designer and for your audience. Useful links: [w3.org...] and [glish.com...]
Content-Negotiation is a mechanism defined in the HTTP specification that makes possible to serve different "versions" of a document (or more generally of a resource) at the same URL, so that user agents can choose which version fit their capacities the best.One of the most classical usage of this mechanism is to serve an image as both GIF and PNG, so that browser that don't understand PNG still gets the GIF version.
[w3.org ]