Reply to Re: Change media of stylesheet

Your name:

Reply:


Posted by wayne on 07/16/06 15:23

Beauregard T. Shagnasty wrote:
> Chris wrote:
>
>> I want to have a printer friendly page. My code is all css based so
>> changing the media type to 'print' in the style definition does what
>> I want. So I would like JS that changes:
>>
>> <link rel="stylesheet" href="Footer.css" media="screen" />
>>
>> to
>>
>> <link rel="stylesheet" href="Footer.css" media="print" />
>
> Why don't you just use two stylesheets? Put a call to both of them in
> your pages.
>
> <link rel="stylesheet" href="Footer.css" media="screen" />
> <link rel="stylesheet" href="printing.css" media="print" />
>
> Note different name. No JavaScript necessary.
> Put all styles relating to printing in the print stylesheet.
> See this site of mine, and do a print preview on any of the pages.
> http://countryrode.com/
> My client keeps a printed copy of
> http://countryrode.com/sales/preowned.php
> on the counter.
>
> Here's the print stylesheet:
> http://countryrode.com/style/crprint.css
>

Or place the print settings in your normal css:

@media print {

body, p {
font-size: 10pt !important;
}

ul {
list-style:square;
margin-top:0em;
margin-bottom:0em;
}

h1 {
text-align : left;
margin : 0em;
font-family : sans-serif;
font-variant : small-caps ;
}

hr {
background-color : #000 ;
color: #000 ;
line-height : 2px;
height : 2px;
}
#head, #menu, #left, #footer, .change-div a {
display:none !important;
}


#content {
background-color: #fff;
width: 100% !important;
border-style: none !important;
text-align:left;
margin: 0 0 0 0 !important;
}

#content a {
text-decoration: none;
}
}

--
Wayne
http://www.glenmeadows.us
With or without religion, you would have good people doing good things
and evil people doing evil things. But for good people to do evil
things, that takes religion.
—Steven Weinberg

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация