使用CSS修改wordpress主题

时间:2017-10-29 10:16:16

标签: html css wordpress

我目前正在使用wordpress主题,并尝试使用CSS修改一些字段。当我在JSfiddle上试用时,我编写的CSS代码工作正常。

我想要达到的目标是: (1)改变"地址"到"重要信息" (2)改变"我们的地址"到"公司地址" (3)隐藏电话行 (4)隐藏电子邮件行

然而,当我将它粘贴到wordpress的CSS部分时,不知何故只实现了与隐藏行相关的更改,即。 3和4

这有什么理由吗?我正在应用我在这个帖子中发现的技术(link

谢谢。

JSFiddle demo

HTML代码

<div class="address-container">
    <h2>Address</h2>




    <div class="content">
                <div class="address-row row-postal-address" itemscope="" itemtype="http://schema.org/PostalAddress">
            <div class="address-name"><h5>Our Address:</h5></div>
            <div class="address-data" itemprop="streetAddress"><p>52 Chesterfield Lane</p></div>
        </div>


                <div class="address-row row-telephone">
            <div class="address-name"><h5>Telephone:</h5></div>
            <div class="address-data">
                <p>-</p>

            </div>

        </div>

                <div class="address-row row-email hide-email">
                    <div class="address-name"><h5>Email:</h5></div>
                    <div class="address-data"><p>-</p></div>
                </div>

                <div class="address-row row-web">
            <div class="address-name"><h5>Web:</h5></div>
            <div class="address-data"><p><a href="www.google.com" target="_blank" itemprop="url">Click here</a></p></div>
        </div>
    </div>
</div>

CSS代码

.address-container h2 {
  font-size: 0;
}

.address-container h2:after {
  content: "Important information";
  font-size: 15px;
}

.address-container .content .address-row.row-postal-address .address-name h5 {
  font-size: 0;
}

.address-container .content .address-row.row-postal-address .address-name h5:after {
  content: "Company address";
  font-size: 15px;
}


.address-row.row-telephone .address-name {
  Display: none;
}

.address-row.row-telephone .address-data {
  Display: none;
}

.address-row.row-email.hide-email .address-name {
  Display: none;
}

.address-row.row-email.hide-email .address-data {
  Display: none;
}

0 个答案:

没有答案