本文介绍了网页生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我很无聊,决定制作一个制作网页的网页。一切正常,输出有效,所以我只是好奇,如果有更容易或更好的如何实现我想要的输出。 XHTML: [HTML]<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Strict // EN" " HTTP://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd"> < html xmlns =" http://www.w3.org/1999/xhtml"郎= QUOT;恩" xml:lang =" en"> < head> < title>< / title> < meta http-equiv =" content-type"含量=" text / html的;字符集= ISO-8859-1" /> < link rel =" stylesheet" HREF ="&的style.css QUOT; /> < script type =" text / javascript" src =" script.js">< / script> < / head> < body> < form name =" bgForm" ID = QUOT; bgForm"行动= QUOT;#" method =" get"> 背景颜色: < select name =" bgColor" id =" bgColor"> < option value ="">无< / option> < option value ="#000" > Black< / option> < option value =" #FFF"> White< / option> < option value =" red"> ; Red< / option> < option value =" blue"> Blue< / option> < option value =" green"> Green< ; / option> < option value =" yellow"> Yellow< / option> < option value =" purple"> Purple< /选项> < option value =" brown"> Brown< / option> < option value =" orange"> Orange< / option> < option value =" pink"> Pink< / option> < option value =" grey"> Gray< / option> < / select> < br /> < br /> 背景图片: < input type =" text"名称= QUOT; bgImage" ID = QUOT; bgImage"值= QUOT;" /> < br /> < br /> 背景重复: 重复 < input type =" radio"命名= QUOT;重复" ID = QUOT; repeat1"值= QUOT;重复" /> 不重复 < input type =" radio"命名= QUOT;重复" ID = QUOT; repeat2"值= [否重复" /> < br /> < br /> 背景位置: < select name =" bgPosition" id =" bgPosition"> < option value =" top"> Top< / option> < option value =" left"> ; Left< / option> < option value =" right"> Right< / option> < option value =" center"> Center< ; / option> < option value =" bottom"> Bottom< / option> < / select> < ; br /> < br /> < input type =" button"的onclick = QUOT;创建()"值= [建立" /> < / form> < / body> < / html> [/ HTML] javascript :I got bored and decided to make a web page that makes web pages. Everything is working and the output is valid so I was just curious if there are easier or "better" ways to accomplish my desired output.XHTML:[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title></title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <link rel="stylesheet" href="style.css" /> <script type="text/javascript" src="script.js"></script> </head><body> <form name="bgForm" id="bgForm" action="#" method="get"> Background Color : <select name="bgColor" id="bgColor"> <option value="">None</option> <option value="#000">Black</option> <option value="#FFF">White</option> <option value="red">Red</option> <option value="blue">Blue</option> <option value="green">Green</option> <option value="yellow">Yellow</option> <option value="purple">Purple</option> <option value="brown">Brown</option> <option value="orange">Orange</option> <option value="pink">Pink</option> <option value="grey">Grey</option> </select> <br /> <br /> Background Image : <input type="text" name="bgImage" id="bgImage" value="" /> <br /> <br /> Background Repeat : Repeat <input type="radio" name="repeat" id="repeat1" value="repeat" /> No-Repeat <input type="radio" name="repeat" id="repeat2" value="no-repeat" /> <br /> <br /> Background Position : <select name="bgPosition" id="bgPosition"> <option value="top">Top</option> <option value="left">Left</option> <option value="right">Right</option> <option value="center">Center</option> <option value="bottom">Bottom</option> </select> <br /> <br /> <input type="button" onclick="create()" value="Create" /> </form></body></html>[/HTML]javascript: 展开 | 选择 | 换行 | 行号推荐答案更改后台重复单选按钮进行选择,并添加repeat-x,repeat-y。 顺便说一句..有没有问题?Change the background repeat radio button to select, and add repeat-x, repeat-y too.Btw.. is there any problem?除此之外,还有以下几点:Besides that, here are some more points: 有获取所选值的快捷方式选择元素:selO bj.value。它应该适用于所有现代浏览器。 您可以在iframe中显示页面中的网页,而不是打开窗口,但这不会验证为XHTML严格。 而不是document.write(),尝试使用DOM方法(document.createElement(),appendChild(),insertBefore()等)。 到目前为止,它太简单了,桌子,表格等怎么样?您需要添加/删除表格/表单按钮,然后添加/删除行/单元格/元素按钮等。 将onclick移动到JavaScript文件以使JavaScript代码不引人注目。 更改后台重复单选按钮进行选择,并添加repeat-x,repeat-y。 Btw ..有什么问题吗?Change the background repeat radio button to select, and add repeat-x, repeat-y too.Btw.. is there any problem? 我可以,但我发现单选按钮看起来更好(有很多文本框)。我将在最终版本中添加所有属性,但是现在我保持简单。 ^ _ ^ 谢谢,死亡I could but I find the radio buttons look better (there are a lot of text boxes as it is). I will be adding all properties in the final version but for now I''m keeping it simple. ^_^Thanks, Death 这篇关于网页生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!