gitlab html 在线预览,HTML style guide

HTML style guide

Semantic elements

Semantic elements are HTML tags that

give semantic (rather than presentational) meaning to the data they contain. For example:

Prefer using semantic tags, but only if the intention is truly accurate with the semantic meaning

of the tag itself. View the MDN documentation

for a description on what each tag semantically means.

Simply visit your Settings to say hello to the world.

...

Simply visit your Settings to say hello to the world.

...

Buttons

Button type

Button tags requires a type attribute according to the W3C HTML specification.

// bad

// good

Links

Blank target

Avoid forcing links to open in a new window as this reduces the control the user has over the link.

However, it might be a good idea to use a blank target when replacing the current page with

the link makes the user lose content or progress.

Use rel="noopener noreferrer" whenever your links open in a new window, i.e. target="_blank". This prevents a security vulnerability documented by JitBit.

When using gl-link, using target="_blank" is sufficient as it automatically adds rel="noopener noreferrer" to the link.

// bad

// good

// good

Fake links

Do not use fake links. Use a button tag if a link only invokes JavaScript click event handlers, which is more semantic.

// bad

// good

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值