This is a discussion on Print view CSS within the Coding Help forums, part of the Webmaster Help category; I'm trying to set up a stylesheet for Printing. Essentially it takes the content of the normal CSS file, then ...
| |||||||
| Register | Forum Rules | FAQ | Donate | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||||
| I'm trying to set up a stylesheet for Printing. Essentially it takes the content of the normal CSS file, then does the things you'd expect like setting background to white, hiding menus, etc. This is the HTML I've got for that : Code: <link rel="stylesheet" type="text/css" media="screen" href="{$base_url}style.css" title="default" />
<link rel="stylesheet" type="text/css" media="print" href="{$base_url}print.css" title="print" />
However, for some reason, printing the page returns a totally unstyled version. Doesn't seem to be any CSS file being passed to it at all. Note : I've also got a 'Switch to Print View' toggle on the page itself, which calls the print.css with JavaScript, and this works fine. But printing it has the same problems as above (no style at all). Can anyone see what I'm doing wrong here? Thanks. |
| |||||
| have you got it online and if so .. can you pm the address and I'll have a quick look ?
__________________ Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it ) Recent Work: Safari Club African Safari Holidays - Malawi Safaris Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools |
| |||||
| Sorry, no can do I know that'll make troubleshooting a bit more difficult.. but can you think of any areas I should be looking at as a cause of the problem? |
| |||||
| all I can think of is ... when you go to print ... only your print.css file is called ... so anything in your style.css sheet will be ignored ... |
| |||||
| Woo! Fixed it Thanks for the help Forbairt, but the problem was with the "title = 'default'" / "title = 'print'" in the stylesheet links. Not entirely sure why (maybe some redundant javascript was causing a problem.. must investigate) but removing that has fixed the printing problems. |
| |||||
| no worries ... glad I couldn't help :P the title bit was the only thing I found weird .. but I didn't think it'd have an effect ... good to know for future for myself as well as I've a few sites I'll need to be able to print .. coming up shortly (though the ones I have with print css .. seem to work fine at the moment ..) |
| |||||
| was just about to tell you the the link for css stylesheet doesn't have the "title tag"
__________________ :. Web Design & Development Web Design Ireland :. Search Engines Optimization Search Engines Optimization :. Directory Submission Directory Submission :. News & Press Release Ireland GiveItSocks.com :. Used Cars Ireland, Car Parts & Car Audio Cars For Sale, Car Parts & Accessories :. I Have 2 Find It Directory SEF Directory |
| |||||
| Yeah, I have a feeling that the title attribute was a requirement of the javascript I was using to dynamically switch stylesheets. I've since got an (obviously, now) better version of that javascript anyway, so they were totally redundant. |
| Tags |
| css, print, view |
| Thread Tools | |
| Display Modes | |
|
|
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ie6 css :hover display:block; issue | matt-dublin | Coding Help | 0 | 17-09-2007 09:05 PM |
| New CSS Gallery Blog | babyboy808 | Site Reviews / Announcements | 13 | 04-07-2007 12:42 PM |
| CSS Image Positioning | borderfox | Coding Help | 13 | 08-05-2007 07:05 PM |
| css styles problem | JESSICA | Coding Help | 4 | 14-02-2007 04:34 PM |
| dynamic css | 7aken | Coding Help | 6 | 10-10-2006 08:13 AM |
| ||||||||
| | ![]() | |||||||