如何在同一行中写入h1和h2? [英] How to write both h1 and h2 in the same line?

查看:705
本文介绍了如何在同一行中写入h1和h2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,我只想制作一个标题。这个标题是一个h1文字,与左边对齐,一个h2与右边对齐,在同一行中,另一个是hr。我的代码到目前为止如下(如果你测试它,你会发现它是错误的):

 < h1 align = 左 >标题< / H1> 
< h2 align =right>上下文< / h2>
< hr />

谢谢你们!

解决方案

关键字 float

 < h1风格= 文本对齐:左;浮动:左; >标题< / H1> 
< h2 style =text-align:right; float:right;>上下文< / h2>
< hr style =clear:both;/>


I have a page and I want simply to make a header. This header is an h1 text aligned to the left, and an h2 aligned to the right, in the same line, and afther them, an hr. My code so far look as follows (if you test it, you'll see that it's wrong):

<h1 align="left">Title</h1> 
<h2 align="right">Context</h2> 
<hr/>

Thanks guys!

解决方案

Keyword float:

<h1 style="text-align:left;float:left;">Title</h1> 
<h2 style="text-align:right;float:right;">Context</h2> 
<hr style="clear:both;"/>

这篇关于如何在同一行中写入h1和h2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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