如何在html中设置行之间的文本 [英] how to set the text between the line in html

查看:133
本文介绍了如何在html中设置行之间的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想在行之间设置文字。

它在中心看起来如下所示



---------让我们开始------- ---



行应该是飞机而不是点缀。

i写的代码如下:

Hi Everyone,

i want to set the text between the line.
it should looks like as follows in center

--------- Lets begin ----------

line should be plane not dotted.
i wrote the code as follows:

<table width="600"  cellpadding="0" cellspacing="0" align="center" class="deviceWidth" bgcolor="" style="margin-top:1%">
<tr>
<td align="left">
<div style="height:2px; background-color: #8000FF; text-align: center">
  <span style=" margin-right:-5%; margin-left:-5%; position: relative; top: -0.5em; color:blue; font-weight:bold;"><br>
   <p3> &nbsp; Lets begin &nbsp;</p3><br>
  </span>
</div>
</td>
</tr>
</table>

推荐答案

目前尚不清楚为何使用br(换行符)标签和p3标签是什么......但是...

It is not clear why do you use br (line break) tags and what p3 tag is...but...
<div style="height:2px; background-color: #8000FF; text-align: center;">
    <span style="position: relative; top: -0.5em; background-color: white; padding: 5px;">Lets begin</span>
</div>


这是你的工具'需要:



Here's the tools you'll need:

<hr> to draw solid lines wherever you wish
style='position=relative; or, possibly even 'absolute;'
top and left styles to position your text
<div> to surround things so they can be positioned







您可以在此处查看这些项目的使用方式:

http:// www.w3schools.com/html/default.asp [ ^ ]



学习自己定位(相关试验错误)对你来说是值得的。




You can see how these items are used here:
http://www.w3schools.com/html/default.asp[^]

Learning to position this yourself (with associated trial an error) is worth it for you.


就在昨天,我给出了这个解决方案的工作精细演示。

你看过了吗?

Just yesterday I gave this solution with the working fine demo.
Did you look into it ?
<p class="lw">Let's Begin</p>




.lw { font-size: 60px; }

.lw span{
  color: #f44;
}

.lw:before{
  display: inline-block;
  content: ' ';
  height: 2px;
  width: 100px;
  background-color: #f44;
  margin-bottom: 20px;
}

.lw:after{
  display: inline-block;
  content: ' ';
  height: 2px;
  width: 100px;
  background-color: #000;
  margin-bottom: 20px;
}



请在此处查看我的答案:

< a href =http://www.codeproject.com/Answers/1043123/HTML-HR-LINE-related-issue?arn=0#answer4> HTML HR LINE相关问题。 [ ^ ]

这正是你想要的:)



-KR


See my answer here:
HTML HR LINE related issue.[^]
This is exactly what you want :)

-KR


这篇关于如何在html中设置行之间的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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