[英]How to display 2 phrases in a single line , one center aligned ,the other right aligned in html?
I want to display the following heading line in HTML:我想在 HTML 中显示以下标题行:
Hello World HTML Example
"Hello World" is center aligned while "HTML Example" is right aligned. “Hello World”居中对齐,而“HTML Example”右对齐。 Which HTML element should I use?我应该使用哪个 HTML 元素?
I've tried using span element and the display:inline css style but the two phrases always display in two separate lines.我试过使用 span 元素和 display:inline css 样式,但是这两个短语总是显示在两个单独的行中。
HTML <h4 align="center" > Hello World <span align="right" > HTML Example </span></h4>
HTML <h4 align="center" > Hello World <span align="right" > HTML Example </span></h4>
Hopefully it's what you're trying to achieve:希望这是您想要实现的目标:
<h4 align="center"> Hello World <span style="float:right;"> HTML Example </span></h4>
Good luck!祝你好运!
<h4 align="center" ><span style="float:left;margin-left:30%"> Hello World</span> <span align="right" style="float:right;margin-right:30%"> HTML Example </span></h4>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.