7 January 2006 3 comments Web development
This blog post is 17 years old! Most likely, its content is outdated. Especially if it's technical.
I learnt an important lesson today about the <link> tag. I had a XHTML Strict that looked like this:
<link rel="stylesheet" type="text/css" media="print"
title="Design for print" href="/print.css" />
And every time I tried to print the page it did not correctly incorporate the print.css
file. The file gets downloaded by the client but not incorporated. After a lot of trial and errors and testing I finally discovered why. The title
attribute stops the link
tag from working.
The correct way to declare a link
tag for a media="print"
is to do the following:
<link rel="stylesheet" type="text/css" media="print"
href="/print.css" />
Hopefully this will help someone else getting into the same pickle as I was in.
- Previous:
- Ask Yahoo "What state do the Simpsons live in?" 5 January 2006
- Next:
- My new years resolution 2006 9 January 2006
- Related by category:
- Fastest way to find out if a file exists in S3 (with boto3) 16 June 2017 Web development
- How to throttle AND debounce an autocomplete input in React 1 March 2018 Web development
- How to create-react-app with Docker 17 November 2017 Web development
- Be very careful with your add_header in Nginx! You might make your site insecure 11 February 2018 Web development
- How to have default/initial values in a Django form that is bound and rendered 10 January 2020 Web development
- Related by keyword:
- mincss "Clears the junk out of your CSS" 21 January 2013
- Find print statements in Python code 12 April 2005
- This site is now 100% inline CSS and no bytes are wasted 5 March 2013
- My favorite CSS Zen Garden design 10 January 2005
- Printer usability problem 24 August 2007
helvete vad tråkig sida. jag kräks. hoppas du hade en trvlig kinatrip. tjock.
Hi for me when i use this link tag, the url is printing when i gave print as follows.
<html>
<head>
<link rel=alternate media=print href="http://someserver/abc.doc">
</head>
<body onload=window.print()>
</body>
</html>
Hi for me when i use this link tag, the url is printing when i gave print as follows.
<html>
<head>
<link rel=alternate media=print href="http://someserver/abc.doc">
</head>
<body onload=window.print()>
</body>
</html>