[英]How to move div to extreme right in wordpress
我正在自定義名為“ Flexible”的wordpress主題。 我在標題部分添加了電話號碼,並希望將其浮動到右側。 但是,即使我做了內聯CSS,也無法執行。 在這里,您可以訪問: www.dbsmiles.net 。
請讓我知道我錯了。 謝謝
這是我的代碼:
<div class="phone" style="margin-top: 10px; clear: right; float: right; margin-right"> <p style="font-weight: 600; font-size: 42px; color: rgb(52, 123, 98); text-shadow: 2px 2px #C5C5C5;">Call Us Today</p> <br/> <p style="font-weight: 600; font-size: 42px; color: #D1D341; text-shadow: 2px 2px #C5C5C5;">954-320-0110</p> </div>
該行為是由外部<h1 id="logo">
-該寬度不夠寬,無法使div
浮動到外部右邊。 您可以嘗試將div
移到header
元素中並重新設置標題的各個部分。
或者您可以使用position: absolute; right: 0px
position: absolute; right: 0px
您的div為position: absolute; right: 0px
,如下所示:
<div style="margin-top: 10px; position: absolute; right:0;" class="phone"> <p style="font-weight: 600; font-size: 42px; color: rgb(52, 123, 98); text-shadow: 2px 2px #C5C5C5;">Call Us Today</p> <br> <p style="font-weight: 600; font-size: 42px; color: #D1D341; text-shadow: 2px 2px #C5C5C5;">954-320-0110</p> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.