如何在 wordpress 中将 div 移动到最右端
How to move div to extreme right in wordpress
我正在定制名为"Flexible"的wordpress主题。我在 header 部分添加了 phone no 并希望将其浮动到右侧。但是即使我做了内联也做不到 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
元素和 header.
的 re-style 部分
或者您可以像这样使用 position: absolute; right: 0px
作为您的 div:
<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>
我正在定制名为"Flexible"的wordpress主题。我在 header 部分添加了 phone no 并希望将其浮动到右侧。但是即使我做了内联也做不到 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
元素和 header.
或者您可以像这样使用 position: absolute; right: 0px
作为您的 div:
<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>