English 中文(简体)
与CSS的对应文本权(RTL站点)
原标题:Align icon to right of text (RTL site) with CSS

I m working on a right to left aligned website (in Hebrew) and would like the icons to appear to the right of the text. For example: http://kaptinlin.com/themes/striking/shortcodes/typography/ at the bottom Contact Us widget, the icon is on the left, I want it on the right.

Here is the relevant code (HTML):

<section id="contact_info-3" class="widget widget_contact_info">
    <h3 class="widgettitle">Contact Us</h3>

    <p><span class="icon_text icon_phone default">(+40) 111 222 333</span></p>

    <p class="contact_address">
        <span>city,&nbsp;state</span>
        <span class="contact_zip">1111</span>
    </p>
    </div>
</section>

CSS:

.icon_text {
    padding:               0 22px 0 0;
    background-image:      url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons.png");
    background-repeat:     no-repeat;
    background-attachment: scroll;
    background-color:      transparent;
}

#footer .icon_text.default {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/footer_icons.png");
}

.icon_globe {
    background-position: -390px 0px;
}

.icon_home {
    background-position: -360px -30px;
}

.icon_email {
    background-position: -330px -60px;
}

.icon_user {
    background-position: -300px -90px;
}

.icon_multiuser {
    background-position: -270px -120px;
}

.icon_id {
    background-position: -240px -150px;
}

.icon_addressbook {
    background-position: -210px -180px;
}

.icon_phone {
    background-position: -180px -210px;
}

.icon_link {
    background-position: -150px -240px;
}

.icon_chain {
    background-position: -120px -270px;
}

.icon_calendar {
    background-position: -90px -300px;
}

.icon_tag {
    background-position: -60px -330px;
}

.icon_download {
    background-position: -30px -360px;
}

.icon_cellphone {
    background-position: 1px -390px;
}

.icon_text.default {
    background-image: url("http://kaptinlin.com/themes/striking/wpcontent/themes/striking/images/icons_black.png");
}

.icon_text.black {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_black.png");
}

.icon_text.gray {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_gray.png");
}

.icon_text.red {
    background-image: url("../images/icons_red.png");
}

.icon_text.orange {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_orange.png");
}

.icon_text.magenta {
    background-image: url(http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_magenta.png);
}

.icon_text.yellow {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_yellow.png");
}

.icon_text.blue {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_blue.png");
}

.icon_text.pink {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_pink.png");
}

.icon_text.green {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_green.png");
}

.icon_text.rosy {
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons_rosy.png");
}

感谢。

最佳回答

您的缩略语为background-image,因此,简而言之,您需要调整patter/code>、background-positiontext-align,将其从左边移至右边。

你们需要作出一些调整。 首先,你们需要确保婚礼由正确的一方而不是左边决定。 之后,您需要调整<代码>后继位置,以将该词贴上:

.icon_text {
    padding: 0 22px 0 0; /* changed from 0 0 0 22px on live site*/
    background-image: url("http://kaptinlin.com/themes/striking/wp-content/themes/striking/images/icons.png");
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-color: transparent;
}

.contact_info_wrap .icon_text, .contact_info_wrap .contact_address {
    padding-right: 26px; /* changed from padding-left on live site */
}

.icon_phone { /* obviously you would change each of the icons as necessary */
    background-position: -72px -210px; /* changed from -180px -210px */
}

然而,这样做将导致你的表象不能相互吻合。 因此,您希望通过调整<代码>ptags使案文与该项权利相一致:

.contact_info_wrap p {
    margin-bottom: 5px;
    text-align: right; /* add this */
}

我猜想你们也希望你们的职衔保持一致:

#footer h3.widgettitle {
    color: #FFFFFF;
    font-size: 24px;
    text-align: right; /* add this */
}
问题回答

如果你需要就你的侵权行为提供进一步援助,请访问圣里克支助论坛,我们将协助你。 RTL一般是直截了当的。 我们可以向您提供将所有身体文本移至侵权行为的法典,并协助你确定要素运动的具体内容。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签