CSS rules

T

Trevor L.

Trevor said:
Yes, that did the job.

Actually I thought of that overnight.
Who says going to sleep on a problem does no good :)

Howver, I now have anther problem

I have this code
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" media="print"
href="print.css"> <style type="text/css">
body {background: lightblue url("")}
</style>
</head>
<body>
<span id="newstext"></span>

<input type="button" value="Print" class="hidden"
onClick="print()">

The function writenews() writes some text into the span
The styleprint.css is
body {background: white }
.hidden {visibility: hidden ;}

When I print I get a grey background

I tried changing print.css to
body {background: white url('')}

and
body {background-color: white }

and neither worked

I posted this on microsoft.public.scripting.jscript, which wasn't really the
right place

Can anyone help with this problem, or suggest a better newsgroup

TIA,
Trevor L.
Website: http://tandcl.homemail.com.au
 
C

Chris Leeds, MVP-FrontPage

I think you need a ; after lightblue:also, if i remember right, on your style sheet, font names with spaces like
Times New Roman need to be in " "

HTH

--
Chris Leeds,
Microsoft MVP-FrontPage

If you make web sites for other people, you should check out ContentSeed:
http://contentseed.com/
--
 
T

Trevor L.

FWIW,

I resolved my problem by re-ordering my styles
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
body {background: lightblue url("")}
</style>
<link rel="stylesheet" type="text/css" media="print" href="print.css">
where print.css is:
body {background: white url("");}
..hidden {visibility: hidden ;}

This gave me all the styles in style.css, overwriting the style for body
with lightblue background when displaying, and with white background when
printing.

This must mean that CSSs cascade in the order in which they are invoked,
and *not* external, then internal, then in-line

Still, this is not a CSS newsgroup.
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
Chris Leeds said:
I think you need a ; after lightblue:also, if i remember right, on your style sheet, font names with spaces
like Times New Roman need to be in " "

HTH

--
Chris Leeds,
Microsoft MVP-FrontPage

If you make web sites for other people, you should check out ContentSeed:
http://contentseed.com/
--
Trevor L. said:
Kieren Evans" <"news[at]jedifans[--=dot=-]com wrote:
Trevor L. wrote:
I have a general body style on style.css
body {
width: 760px;
font: 16px Times New Roman,Arial,Helvetica,sans-serif;
background: lightblue

url("images/display/04-08-24-1-bird-bath.jpg") repeat fixed;}
There are also other styles

On a particular page, I want some of the styles on style.css but a
different background - just a blue colour

So I tried
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
body {background-color: lightblue}
</style>

I did not get the background color. Instead I got the birdbath.jpg

How am I breaking the CSS rules?
What do I have to do without repeating all the styles in a separate
<style></style> section in <head>?

to override try:
background:lightblue URL('');

--
Hope This Helped and MTFBWY...
Kieren aka JediFans - <URL:http://jedifans.com/>
The Force Is With Me, SUSE Linux 10.0, Mozilla Firefox 1.5 Beta 2,
Mozilla Thunderbird 1.5 Beta 2 and Revenge Of The Sith!

Yes, that did the job.

Actually I thought of that overnight.
Who says going to sleep on a problem does no good :)

Howver, I now have anther problem

I have this code
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" media="print"
href="print.css"> <style type="text/css">
body {background: lightblue url("")}
</style>
</head>
<body>
<span id="newstext"></span>

<input type="button" value="Print" class="hidden"
onClick="print()">

The function writenews() writes some text into the span
The styleprint.css is
body {background: white }
.hidden {visibility: hidden ;}

When I print I get a grey background

I tried changing print.css to
body {background: white url('')}

and
body {background-color: white }

and neither worked

I posted this on microsoft.public.scripting.jscript, which wasn't really
the right place

Can anyone help with this problem, or suggest a better newsgroup

TIA,
Trevor L.
Website: http://tandcl.homemail.com.au
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top