如何将一个表单和一个表单外的超链接并排显示?

将表单放进div块中,并设置style属性为float(代码中省略了新闻分类部分)

<form name ="searchForm" id="searchForm" action="/news/jsp/admin/newsDetailList.jsp" method="post">
  <div style="float:left;">
    新闻标题<input type="text" name="title" id="title" value=''/>
       <button type="submit" class="page-btn">搜索</button>
  </div>
</form>

 

按钮也设置style属性为float

<a href="addNews.jsp" style="float:right;"><button>增加</button></a> 

 

超链接内可嵌套一个按钮,最后显示为按钮的样子

 

posted @ 2019-02-21 17:18  锈钉  阅读(390)  评论(0)    收藏  举报