负余量不适用于jQuery .css({

时间:2015-05-21 20:12:08

标签: javascript jquery css

sender = serializers.IntegerField(
    required=False,
    write_only=True, # <---
    allow_none=True,
    blank=True)

$('#thankYouMessage').css({"height": textHeight, "margin-top:": "-52px", "padding-left": "19px"}); 会执行但没有负余量吗? (padding-left:被忽略)

2 个答案:

答案 0 :(得分:3)

请注意,"margin-top:"应为"margin-top"(不含“:”)

答案 1 :(得分:3)

$('#thankYouMessage').css({"height": textHeight, "margin-top": "-52px", "padding-left": "19px"});

你在margin-top

旁边有一个额外的冒号