我想在Google应用脚本中使用CSS更改单选按钮的大小,以便部署为网页
我尝试了这个属性但没有改变单选按钮大小
function doGet(){
var width = 100;
var height = 100;
var appWidth = 990;
var appHeight = 1400;
var radio_attributes = {"fontSize":"4em","height":"200%","width":"200%","display":"inline- block")};
var app = UiApp.createApplication().setWidth(appWidth).setHeight(appHeight);
var panel = app.createVerticalPanel().setId("panel").setWidth(appWidth).setHeight(appHeight);
var radio = app.createRadioButton("radioButton", "test").setFormValue('test').setHeight(height).setWidth(width).setStyleAttributes(radio_attributes);
panel.add(radio);
app.add(panel);
return app;}
答案 0 :(得分:0)
对于Css,您必须在项目中创建其他脚本。 例如:
css.gs:
var css={};
css.title = { width : '660px',
paddingTop :'10px',
margin:' -12px -11px -10px',
background : 'white',
color : '#093B65',
textAlign : 'center',
fontWeight: 'bold',
borderRadius: '5px',
border: '2px solid #2081D4'
};
为你代码:
Code.gs
var panelTitle = app.createVerticalPanel().setStyleAttributes(css.title);
答案 1 :(得分:0)
Css按钮
css.button = { width : '100px', height : '30px', fontWeight: 'bold', borderRadius: '10px', background : 'blue', color: 'white'};
我的按钮
var button = app.createSubmitButton('submit').setEnabled(true).setStyleAttributes(css.button);
这个例子可以帮到你吗?