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

Visualforce CSS and div tags

I am having issue referencing a simple stylesheet in my visualforce page.

I created a CSS with simple code:
  margin-left: auto;
  margin-right: auto;
  background-color: red;

then i uploaded this in my static resource and now im trying to refrence this particular CSS in my div tag but it is not working.

here is what i have in my VF page:

<apex:page showHeader="false" sidebar="false" >
  <apex:stylesheet value="{!$}"/>
  <apex:form >
      <div class="center" >
          CENTER THIS

I am not sure what else to do. I can hard code the CSS in the VF Page but I have  a lot of div tags with different CSS. Can anyone help me on this?
Try to inspect rendered page in the browser to see if CSS is imported. If it is, try setting standardStyleSheets="false" in <apex:page>.. Hope this helps.
I looked into this and SFDC doesn't even import the style sheets. I already tried setting the standard stylesheets to false, but still no luck. I also tried doing a link href but doesnt work either.