You need to sign in to do that
Don't have an account?

CSS style not being applied for renderAs="pdf"
Baffling, I don't think I am doing anything wrong since I've created PDFs like this before. Based on the code below, the div should pick up the style. Not the case.
<apex:page renderAs="pdf">
<html>
<head>
<style>
#message {
color: red;
}
</style>
</head>
<div id="message">Should display in red</div>
</html>
</apex:page>
I have other PDF pages that render out correctly. I copied that code over to this new VF page. Same issue as stated. I've tried with recreated a new VF page. No success. I am stumped. Any help is appreciated.
Seems like you figured out and resolved the issue by fixing version number. However, if you want to use the latest version i.e. 27.0 then You do not need to specify <html> tags explictly on your page.
Try removing the <html> tag from your code and check. It should work.
Cheers!
Try this one.
<apex:page renderAs="pdf" standardStyleSheet = "false">