jQuery CSS borderWidth

后端 未结 3 1737
谎友^
谎友^ 2020-12-20 19:24

I\'m unable to get the border width of an element. I tried the following but it shows empty results. Check http://jsfiddle.net/s7YAN/14/

$(\'div\').css(\'bor         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-20 19:58

    The problem is you don't define the border-style in your CSS, so it's default to none, whose width is 0px.

    Also, you should specify which border (left, top) for border-width is just a shortcut for all borders.

提交回复
热议问题