[英]How can I have two objects aligned horizontally (one to the right of the other) and center the left one?
[英]How to display 2 phrases in a single line , one center aligned ,the other right aligned in html?
我想在 HTML 中顯示以下標題行:
Hello World HTML Example
“Hello World”居中對齊,而“HTML Example”右對齊。 我應該使用哪個 HTML 元素?
我試過使用 span 元素和 display:inline css 樣式,但是這兩個短語總是顯示在兩個單獨的行中。
HTML <h4 align="center" > Hello World <span align="right" > HTML Example </span></h4>
希望這是您想要實現的目標:
<h4 align="center"> Hello World <span style="float:right;"> HTML Example </span></h4>
祝你好運!
<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.