doujumiao5024 2017-07-18 02:59
浏览 48
已采纳

链接中的文本在WordPress中对齐不正确,但在HTML中很好

Static HTML version WordPress Version

As you can see in the images, the text "English" isn't vertically centered in the WordPress version of the site I'm building but with the same code as I used in the HTML version it works perfectly. Any ideas why?

HTML

<div class="right-bar">
    <a class="language">
        <img src="img/flags/EN-us.png" alt="English / US">
        <span>English</span>
    </a>
    <a class="search-btn">
        <i class="fa fa-search"></i>
    </a>
</div>

SASS

.right-bar {
        background: #1f1f1f;
        float: right;
        height: 100%;
        padding: 32px 20px 0;
        position: relative;

        &::after {
            position: absolute;
            top: 0;
            right: 100%;
            content: "";
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 0 0 98px 83px;
            border-color: transparent transparent #1f1f1f;
        }

        .language {
            border: 1px solid #363636;
            border-radius: 40px;
            color: #898989;
            display: block;
            float: left;
            height: 34px;
            font-size: 10px;
            font-weight: 700;
            line-height: 30px;
            padding: 0 20px;
            position: relative;
            text-transform: uppercase;
            z-index: 99;
        }

        .search-btn {
            float: left;
            display: block;
            margin: 0 0 0 30px;
            color: #fff;
            font-size: 26px;
            font-weight: 400;
            transition: color .2s;

            &:active {
                color:#8eb82f;
            }
        }
    }
  • 写回答

1条回答 默认 最新

  • donglaogu3788 2017-07-18 03:08
    关注

    SCSS

    .language{
      img{
      vertical-align:middle;
      }
    }
    

    This may help you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题