I have VF page where I have css in style. The css works when it is a normal page. Issue comes when we change the page to pdf. When I render the page as pdf the css written on VF page is getting displayed as it is (as text). The css is not working. Can any one tell me what is the reason for this issue. My VF page :
<apex:page controller="SendAndAttachSpecialPriceForm_Controller" sidebar="false" showHeader="false" id="mainpageID" >
<apex:form id="mainformID">
<style type="text/css">
form{
padding : 40px;
}
.headingStyle{
padding-left : 500px;
font-size : 30px;
font-weight : bold;
}
table#tableStyle{
border : 1px solid black;
border-collapse : collapse;
width : 500px;
font-size : 16px;
}
tr, td{
border : 1px solid black;
padding-left : 15px;
}
th{
padding-left : 15px;
}
tr#heading{
border-collapse : collapse;
}
div#enduserdivID{
padding-top : 90px;
}
div#resellerdivID{
padding-top : 95px;
}
</style>
<apex:image url="{!URLFOR($Resource.company_Logo)}"/>
<apex:outputPanel id="mainOutpanalID">
<br/>
<apex:outputText id="headID" value="Special Pricing Authorization" styleclass="headingStyle"></apex:outputText>
<br/>
<!-- Table for Enduser Information -->
<div id="enduserdivID">
<table id="tableStyle">
<body>
<tr id="heading">
<th>Enduser Information:</th>
<th></th>
</tr>
<tr>
<th>Company</th>
<td>{!accInformation.Name}</td>
</tr>
<tr>
<th>Name</th>
<td>{!accInformation.Name}</td>
</tr>
<tr>
<th>Address</th>
<td>{!accInformation.BillingCountry}</td>
</tr>
<tr>
<th>City, State Zip</th>
<td>{!accInformation.BillingCity}, {!accInformation.BillingState} {!accInformation.BillingStateCode}</td>
</tr>
<tr>
<th>Email</th>
<td>{!accInformation.PersonEmail}</td>
</tr>
<tr>
<th>Phone Number</th>
<td>{!accInformation.Phone}</td>
</tr>
</body>
</table>
</div>
The issue only comes when we render the VF page as pdf.