Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
CSS与HTML常见的使用误区_创想鸟

CSS与HTML常见的使用误区

这次给大家带来CSS与HTML常见的使用误区,CSS与HTML使用的注意事项有哪些,下面就是实战案例,一起来看一下。

误区一.多p症 

上述使用使用多余的p标签现状,就称为“多p症”,理应简化成下

误区二.多类class症  注意点class可以应用于页面任意多个元素,非常适合标识内容类型或其他相似的条目

一段新闻(新闻标题、新闻详情内容)

Elastic Layout Example—View Source for the HTML and CSS

Lorem ipsum dolor sit amet. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

上述类名使用news-head与news-text 就称为”多类症“表现,不需要这么多的类区分元素样式

最好使用p(pision)代表部分而不是没有语义(大多数人误解p无语义!!!),实际上p可以将文档划分为几个有意义的区域.

类名news从而识别整个新闻条目。然后可以使用层叠(cascade)样式识别新闻标题、文本,理应修改如下

Elastic Layout Example—View Source for the HTML and CSS

Lorem ipsum dolor sit amet. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

span 对行内元素进行分组或标识

Andy wins an Oscar for his cameo in Iron Man

Public and on Februray 22nd, 2009 By Harry Knowles

误区三.id使用误区 用于标识页面上特定元素(比如站点导航、页眉、页脚)而且必须唯一; 也可以用来标识持久结构性元素(如主导航、内容区域)

/*大量的使用id,很难找到唯一名称混乱*/#andy, #rich, #jeremy, #james-box, #sophie {    font-size: 1em;    font-weight: bold;    border: 1px solid #ccc;}/*只需一个普通类替代它*/.staff {    font-size: 1em;    font-weight: bold;    border: 1px solid #ccc;}

用于标识页面上特定元素(比如站点导航、页眉、页脚)而且必须唯一; 也可以用来标识持久结构性元素(如主导航、内容区域)

CSS与HTML常见的使用误区

相信看了本文案例你已经掌握了方法,更多精彩请关注创想鸟其它相关文章!

推荐阅读:

百度贴吧的3D翻牌效果

css3实现动画自行车效果

以上就是CSS与HTML常见的使用误区的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1609601.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年12月24日 00:52:19
下一篇 2025年12月24日 00:52:31

相关推荐

发表回复

登录后才能评论
关注微信