CSS for printing

H

Helpful person

I have a CSS for displaying to the monitor which is linked into my page
as follows:
<link rel="stylesheet" type="text/css" href="screen.css"
media="screen">

I have a CSS for displaying to the printer which is linked to my page
as follows:
<link rel="stylesheet" type="text/css" href="print.css" media="print">

In my print.css I have the line:
div .test {display: none}

On my page I have a layer named test

I am expecting the layer named test to show on the screen but not on
the printed page. However, it shows on both. What am I doing wrong?
 
T

Trevor L.

Helpful said:
I have a CSS for displaying to the monitor which is linked into my
page as follows:
<link rel="stylesheet" type="text/css" href="screen.css"
media="screen">

I have a CSS for displaying to the printer which is linked to my page
as follows:
<link rel="stylesheet" type="text/css" href="print.css" media="print">

In my print.css I have the line:
div .test {display: none}

On my page I have a layer named test

I am expecting the layer named test to show on the screen but not on
the printed page. However, it shows on both. What am I doing wrong?

I think there are two problems
1. The css should be
div.test {display: none}
or even just
..test {display: none}

2. The div to hide is not *named* test. It is given that class
i.e. <div class="test">

An alternative is to use an id

div#test {display: none}
or even just
#test {display: none}

The div is then given an *id* of test
i.e. <div id="test">
 
M

Murray

Like Trevor, I am a little confused about what your div tag's code looks
like. Can you show me?
 
H

Helpful person

Trevor said:
I think there are two problems
1. The css should be
div.test {display: none}
or even just
.test {display: none}

2. The div to hide is not *named* test. It is given that class
i.e. <div class="test">

An alternative is to use an id

div#test {display: none}
or even just
#test {display: none}

The div is then given an *id* of test
i.e. <div id="test">


Thank you very much. div#test {display: none} woks perfectly.
 

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