Skip to content

Instantly share code, notes, and snippets.

@kevinbubu
Created May 18, 2013 04:14
Show Gist options
  • Save kevinbubu/5603208 to your computer and use it in GitHub Desktop.
Save kevinbubu/5603208 to your computer and use it in GitHub Desktop.
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var web = Ti.UI.createWebView({
html:'<html>' +
' <head>' +
' <style type="text/css">' +
' body {background-color: yellow}' +
' h1 {background-color: #00ff00}' +
' h2 {background-color: transparent}' +
' p {background-color: rgb(250,0,255)}' +
' p.no2 {background-color: gray; padding: 20px;}' +
' </style>' +
' </head>' +
' <body>' +
' <h1>這是標題 1</h1>' +
' <h2>這是標題 2</h2>' +
' <p>這是段落</p>' +
' <p class="no2">這個段落設置了內邊距。</p>' +
' </body>' +
'</html>'
});
win.add(web);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment