dollar Posted February 26, 2009 Share Posted February 26, 2009 I'm practicing coding but the problem is it's very hard to : open notepad,write code, save with .html , open it in browser...So is there's any W3Schools Offline version or editor like this? : I mean I write the code left side and result should appear in right or something like that.. Link to comment Share on other sites More sharing options...
jesh Posted February 26, 2009 Share Posted February 26, 2009 No, but you can write your own: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><style type="text/css">textarea, iframe {width:200px;height:200px;}td {vertical-align:top;text-align:center;}</style><script type="text/javascript">function tryit(){ var html = document.getElementById("code").value; ifrm = document.getElementById("output"); var doc = ifrm.contentDocument || ifrm.contentWindow.document; doc.open(); doc.write(html); doc.close();}</script></head><body><table cellspacing="4" cellpadding="0" border="0"> <tr> <td> <textarea id="code"><html><body>Hello World!</body></html></textarea> <br /> <button onclick="tryit();">Do it!</button> </td> <td> <iframe id="output"></iframe> </td> </tr></table></body></html> I only (briefly) tested this in IE6 and Firefox. Link to comment Share on other sites More sharing options...
dollar Posted February 26, 2009 Author Share Posted February 26, 2009 No, but you can write your own:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><style type="text/css">textarea, iframe {width:200px;height:200px;}td {vertical-align:top;text-align:center;}</style><script type="text/javascript">function tryit(){ var html = document.getElementById("code").value; ifrm = document.getElementById("output"); var doc = ifrm.contentDocument || ifrm.contentWindow.document; doc.open(); doc.write(html); doc.close();}</script></head><body><table cellspacing="4" cellpadding="0" border="0"> <tr> <td> <textarea id="code"><html><body>Hello World!</body></html></textarea> <br /> <button onclick="tryit();">Do it!</button> </td> <td> <iframe id="output"></iframe> </td> </tr></table></body></html> I only (briefly) tested this in IE6 and Firefox. Thanks a ton jesh. One small doubt here : how to change the height and width of right side (result) table(box) ? Link to comment Share on other sites More sharing options...
jesh Posted February 26, 2009 Share Posted February 26, 2009 Have a look through the CSS tutorials. Particularly the section related to dimensions:http://www.w3schools.com/css/css_dimension.asp Link to comment Share on other sites More sharing options...
htmlcoder Posted April 24, 2009 Share Posted April 24, 2009 nice! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.