leohxj
V2EX  ›  问与答

大家id和class命名时喜欢使用中划线还是下换线?

  •  
  •   leohxj · Jul 15, 2013 · 2910 views
    This topic created in 4697 days ago, the information mentioned may be changed or developed.
    我个人喜欢下划线,可以双击选中。
    但是很多网站中使用的是中划线,能说说为什么吗?
    4 replies    1970-01-01 08:00:00 +08:00
    lichao
        1
    lichao  
       Jul 15, 2013   ❤️ 1
    喜欢用中划线,没有特别的理由
    alexrezit
        2
    alexrezit  
       Jul 15, 2013   ❤️ 1
    无线, 使用驼峰式...
    leohxj
        3
    leohxj  
    OP
       Jul 15, 2013
    @alexrezit
    @lichao 听说id和class会被注册为window下对象,所以使用中划线防止命名冲突?
    lichao
        4
    lichao  
       Jul 15, 2013
    @leohxj 没听说过
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   956 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 20:10 · PVG 04:10 · LAX 13:10 · JFK 16:10
    ♥ Do have faith in what you're doing.