html显示同一行中的div [英] html display div in same line

查看:119
本文介绍了html显示同一行中的div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在我的jsp页面上显示文本:

 示例日期:< div id =sampleDate/ > 

所以我希望它显示为样本日期:29-Aug- 2012年



但是它会像这样:

样本日期:



2012年8月29日



任何人都可以帮助我吗?

 样本日期:< span id =sampleDate>< / span> 

我不会推荐这个,但如果您想保留DIV,那么您必须将它内联元素 -

 样本日期:< div id =sampleDate>< / div> 

#sampleDate {display:inline; }


I wish to display a text on my jsp page:

Sample date: <div id="sampleDate"/>

So I want it to be displayed as Sample date: 29-Aug-2012

But it is coming up like this:

Sample Date:

29-Aug-2012

Can anyone help me with this?

解决方案

Write it as -

Sample date: <span id="sampleDate"></span>

I won't recommend this but still if you want to keep DIV then you have to make it inline element -

Sample date: <div id="sampleDate"></div>

#sampleDate{ display: inline; }

这篇关于html显示同一行中的div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆