You need to sign in to do that
Don't have an account?
ericmonte
Visualforce CSS and div tags
I am having issue referencing a simple stylesheet in my visualforce page.
I created a CSS with simple code:
.center{
width:976px;
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="{!$Resource.center}"/>
<apex:form >
<div class="center" >
CENTER THIS
{!$Resource.center}
</div>
</apex:form>
</apex:page>
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?
I created a CSS with simple code:
.center{
width:976px;
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="{!$Resource.center}"/>
<apex:form >
<div class="center" >
CENTER THIS
{!$Resource.center}
</div>
</apex:form>
</apex:page>
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?
olegforce
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.
ericmonte
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.