使用與Figma設計相同的CSS值,產生不同的值
P粉642919823
P粉642919823 2023-09-06 18:59:32
0
2
394

我正在嘗試實現Figma 的設計,但注意到它並不總是準確的:

這是我要建立的輸入欄位:

請注意文字有多薄。這些是來自 Figma 的值:

color: var(--heading-black, #222);
/* Button/16/Regular */
font-family: Inter;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 16px;

我也使用相同的顏色和字體粗細,我甚至嘗試使用 100 而不是 400,但我的結果是:

我的文字比較厚,我不知道為什麼。這是我的輸入欄位的 CSS 程式碼:

.search-field {
    margin-left: 65px;
    width: 429px;
    height: 44px;   
    font-size: 16px;
    font-weight: 400;
    padding-left: 46px;
    background: url("../../../assets/icons/search.png") no-repeat;
    background-color: white;
    background-size: 21px;
    background-position: 14px center;
    border: none;
    border-radius: 4px;
    outline: none;
    color: #222;
}

和 html:

<input type="text" class="search-field" value placeholder="Booking.com, Expedia, Otto...">

我做錯了什麼?

P粉642919823
P粉642919823

全部回覆(1)
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!