function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC coderSFDC coder 

Css styles not applied in VF email template when rendered as pdf

hi all,

i am creating an VF email template wherein i am sending an attachment in pdf format.However the styling that i am applying through css is not working.
can anyone help me?below is my code

<messaging:emailTemplate subject="{!relatedTo.Business_Partner__c}confirm next visit date please" 
<messaging:htmlEmailBody >
    table,td,th{border-style: groove;  border-collapse: collapse;}
        <center><apex:image value="{!$Resource.MaxxiumHeader}" alt="header"/></center>
        <p>Dear {!},</p>
        <p>I would like to confirm our Product Order detail</p>
           <th>Product Name</th>
           <th>Product Brand</th>
           <th>Product Category</th>
           <th>Net Price</th>
        <p>Thank you for your confirmation.</p>
        <p>Kind Regards,</p>
<messaging:attachment renderAs="PDF">

<style type="text/CSS">
  <apex:outputText styleClass="colorStyle">Wholesaler Information         </apex:outputText>
   <apex:repeat value="{!relatedTo.Wholesaler__r}" var="acc">



RamuRamu (Salesforce Developers) 
This article might help

// There is a mistake in this code. you should write this way

     background-color: #A0A0A0;
If this answer resolve your issue, please mark it as solution.
nitesh gadkarinitesh gadkari

You need to use inline CSS.
Vijay Kumar YadavVijay Kumar Yadav
I had used inline CSS but still CSS effects are not seen in pdf