本例是Css中inline的用法,我们在日常的网页制作中,可能遇到这样的问题,按钮和文本框不在同一水平线上,这个要怎么解决呢?本文就是解决案例,用到了,CSS的语法:display:inline,如果你对CSS了解还是不足,建议阅读烈火学院提供的CSS中文手册。 演示: <!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> <title>inline表单</title> <style> form { display: inline; } input.txt { color: #00008B; background-color: #E3F2F7; border: 1px inset #00008B; width: 200px; } input.btn { color: #00008B; background-color: #ADD8E6; border: 1px outset #00008B; } </style> </head> <body> 请输入您的 email 地址: <form method="post" action=""> <input type="text" name="name" id="name" class="txt" /> <input type="submit" name="btnSubmit" id="btnSubmit" value="Submit" class="btn" /> </form> </body> </html><br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>提示:可修改后代码再运行! 文章导航 CSS美化Calendar日历的雏形,并无日历功能CSS给select下拉列表的文字增加背景色