四、Salesforce Styles_1

1.静态变量的使用:<apex:stylesheet value="{!$Resource.TestStyles}"/>
2.<apex:page>
<style type="text/css">
p { font-weight: bold; }
</style>
<p>This is some strong text!</p>
</apex:page>
3.css:h1 { color: #f00; }
    p { }
    newLink { color: #f60; font-weight: bold; }
引用:<apex:page showHeader="false">
<apex:stylesheet value="{!$Resource.customCSS}" />
<h1>Testing Custom Stylesheets</h1>
<p>This text could go on forever...<br/><br/>
But it won't!</p>
<apex:outputLink value="http://www.salesforce.com" styleClass="newLink">
Click here to switch to www.salesforce.com
</apex:outputLink>
</apex:page>
4.styleClass="asideText" 引用<style type="text/css">  .asideText { font-style: italic  </style>

5.根据ID:<apex:page>
<style type="text/css">
[id*=myId] { font-weight: bold; }
</style>
<apex:outputText id="myId" value="This is way fancy !"/>
</apex:page>
6.判断浏览器:HTML Comments and IE Conditional Comments
7.嵌入html 和 head :<apex:page showHeader="false" sidebar="false" standardStylesheets="false"
applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<html>
<body>
<header>
<h1>Congratulations!</h1>
</header>
<article>
<p>This page looks almost like HTML5!</p>
</article>
</body>
</html>
</apex:page>
8.当applyHtmlTag="false"时,其他元素是不好用的 ,除了红色标记

<html>
<apex:includeScript
value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/>
</html>
9.Custom Doctype Example
<apex:page docType="xhtml-1.0-strict" title="Strictly XHTML"
showHeader="false" sidebar="false">
<h1>This is Strict XHTML!</h1>
<p>
Remember to close your tags correctly:<br/>
<apex:image url="/img/icon-person.gif" alt="Person icon"/>
</p>
</apex:page>
10.Microsoft Excel ContentType Example
contentType="application/vnd.ms-excel"
11.Render a Visualforce Page as a PDF File
<apex:page renderAs="pdf">


 

转载于:https://www.cnblogs.com/bandariFang/p/5446030.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值