• 请不要在回答技术问题时复制粘贴 AI 生成的内容
iugo
V2EX  ›  程序员

分享一个尴尬时刻, CSS

  •  
  •   iugo ·
    iugo · Mar 10, 2020 · 4062 views
    This topic created in 2441 days ago, the information mentioned may be changed or developed.

    在留白的时候, 写 padding: 2rem, 10rem, 然后不能用, 当时还很烦躁, 怎么就不能用呢?

    借口: 很久不写 CSS 了, 不熟悉嘛. 🙈

    11 replies  •  2020-03-10 21:59:54 +08:00
    zhoufenfens
    zhoufenfens
    Mar 10, 2020
    1
    因为是行内元素
    miao666
    miao666
    Mar 10, 2020 via Android
    2
    分割用空格,不是逗号
    huguotai
    huguotai
    Mar 10, 2020
    3
    padding: 2rem 10rem;即可
    noobsheldon
    noobsheldon
    Mar 10, 2020❤️3
    4
    update user set user_type = 2 and name = "jack" where id = 1; 怎么老是不生效啊
    Mutoo
    Mutoo
    Mar 10, 2020
    5
    padding: 2rem/*,*/10rem
    zhw2590582
    zhw2590582
    Mar 10, 2020
    6
    用 sass 没烦恼
    llb123
    llb123
    Mar 10, 2020
    7
    F12 不就知道错哪了么。。
    CloudMx
    CloudMx
    Mar 10, 2020
    8
    @noobsheldon update user set user_type = 2 and name = "jack" where id = 1; -->
    你要表达的意思是?:
    update user set user_type = 2,name = "jack" where id = 1;
    iugo
    iugo
    OP
    Mar 10, 2020
    9
    都像 noobsheldon 一样多好. 谁还没个脑抽抽的时候, 来, 舞台给大家.
    mostkia
    mostkia
    Mar 10, 2020
    10
    首先,如果不是块级元素,有时候会出现 padding 加不上去的情况,比如 em、span、i、b 等这类标签,默认情况下内内边距加上去也没什么用,而外边距都只能加左右两边。如果需要定义这类标签得边距,请使用 display:block,或者使用 display:inline-block 来初始化。还有,你发上来的语法是错的,css 参数分割不需要逗号,可能你吧其他语言的习惯带进来了。
    indev
    indev
    Mar 10, 2020
    11
    padding: 2rem 10rem;
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1837 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 06:41 · PVG 14:41 · LAX 22:41 · JFK 01:41
    ♥ Do have faith in what you're doing.