You do have an answer (above) which may serve... but for best results, post the code you've written; the error messages it produces (or describe the failure with great specificity).
And, while it's NOT customarily advisable, this is one that could be tackled with a
simple regex: search from the start of the .html file to </head> for rel="stylesheet" or even for .css and, when found, use a capturing regex to get the (relative) link. Then, of course, for that to be much use, you'll need to concat the site address...
And just BTW, that's not guaranteed to produce a valid link to the stylesheet (identifying the reason is left as an exercise for the pupil). OTOH, since I'm hard pressed to find a practical use for your desired code, (unless you collect style sheets the way NodeReaper collects toe tags) perhaps this is homework... which should also be disclosed when posting here.
Update: s/and way/the way/ in last para.