简体   繁体   English

您如何做到这一点,以便有人无需输入文本框即可在您的网站上“输入”?

[英]How do you make it so someone can 'type' on your website without input text box?

So I am currently developing a terminal like website where you put in a command and something happens. 因此,我目前正在开发类似网站的终端,您在其中输入命令并发生了某些情况。 This is what my CSS and HTML files looks like... 这就是我的CSS和HTML文件的样子...

 p { color: white; font-family: fixedsys, LucidaTerminal, monospace } .blink_text { -webkit-animation-name: blinker; -webkit-animation-duration: 1s; -webkit-animation-timing-function: linear; -webkit-animation-iteration-count: infinite; -moz-animation-name: blinker; -moz-animation-duration: 1s; -moz-animation-timing-function: linear; -moz-animation-iteration-count: infinite; animation-name: blinker; animation-duration: 1s; animation-timing-function: linear; animation-iteration-count: infinite; color: white; } @-moz-keyframes blinker { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; } } @-webkit-keyframes blinker { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; } } @keyframes blinker { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; } } 
 <!DOCTYPE html> <head> <link rel="stylesheet" type="text/css" href="interface.css"> </head> <body style="background-color:black;"> <p style="display:inline">~/Link/Hydrogen/Helium/Lithium></p> <span class="blink_text">_</span> </body> 
So what I want is the user can type in a command, press enter, and something will happen, like "print 'python'" or like a help command that displays all commands. 因此,我想要的是用户可以键入命令,然后按Enter,然后会发生一些事情,例如“ print'python'”或显示所有命令的帮助命令。 Also how do I make it so that when they press enter a command is executed. 还有我该怎么做,以便当他们按Enter时执行命令。

Use a form with a textarea and make the borders and the background transparant. 使用带有文本区域的表单,并使边框和背景透明。 Do not add a submit button. 不要添加提交按钮。 Submit (with javascript fallback) on pressing enter. 按下Enter提交(使用JavaScript后备)。 Does that work for you? 那对你有用吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 怎么用flask把网站的文字变成蓝色? - How can you use flask to make the text of your website blue? 当您在输入字段中键入内容时,使文本出现在网站上? - Make text appear on website as you type in an input field? 如何让网站使用 localStorage 将我们输入的内容保存到输入框中? - How do I make a website save what we type into an input box using localStorage? 当Input的值小于4时,如何使文本上升并使其大于4? - How do you make it so when an Input has a value under 4, it will make a text go up and make them do it over 4? 如何设置文本输入的样式,以便在不使用背景图像的情况下在左侧显示一个图标? - How do you style a text input so that there's an icon on the left without using background-image? 您可以通过为网站中不同类型的文件制作单独的文件来使您的 public_html 更有条理吗? - Can you make your public_html more organized by making separate files for your different type of files in your website? 如何使输入文本消失? - How do you make the input text disappear? 如何在开始输入后使HTML输入框默认文本删除 - How do I make a HTML input box default text remove AFTER starting to type 您可以输入文本,但可以键入文本,但不允许删除文本吗? - Can you make a text input that allows you to type text, but doesn't allow you to delete text? 您如何在网站中实施quickblox? - How do you implement quickblox in your website?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM