<! DOCTYPE html>
< html >
< head >
< title >ExtJs</ title >
< meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
< link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
< script type="text/javascript" src="ExtJs/ext-all.js"></ script >
< script type="text/javascript" src="ExtJs/bootstrap.js"></ script >
< script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></ script >
< script type="text/javascript">
Ext.onReady(function(){
var panel = new Ext.Panel({
title: 'SAMPLE',
renderTo: 'sub1',
width: '500px',
html: '< div id="div0" style="height:260px;padding:5px" class="myclass">我是内容部分</ div >'
});
Ext.util.CSS.createStyleSheet('.myclass{color:red}', 'the');
var cssObj = Ext.util.CSS.getRule(".myclass", true);
Ext.Msg.alert("获取的信息", "创建样式表" +
'< br >获取myclass样式表中规则的字体颜色:' + cssObj.style.color);
});
</ script >
</ head >
< body >
< div id=sub1></ div >
</ body >
</ html >
|