amazeui学习笔记--css(常用组件5)--评论列表Comment
amazeui学习笔记--css(常用组件5)--评论列表Comment
一、总结
1、am-comment:使用am-comment来声明评论对象,这个是放在article里面的,虽然article也是div来的
2、comment基本结构如下:
<article class="am-comment"> <!-- 评论容器 -->
<a href="">
<img class="am-comment-avatar" alt=""/> <!-- 评论者头像 -->
</a> <div class="am-comment-main"> <!-- 评论内容容器 -->
<header class="am-comment-hd">
<!--<h3 class="am-comment-title">评论标题</h3>-->
<div class="am-comment-meta"> <!-- 评论元数据 -->
<a href="#link-to-user" class="am-comment-author">..</a> <!-- 评论者 -->
评论于 <time datetime="">...</time>
</div>
</header> <div class="am-comment-bd">...</div> <!-- 评论内容 -->
</div>
</article>

3、评论列表:还是ul包着li的形式,<ul class="am-comments-list am-comments-list-flip">各种包含am-comment的li标签</ul>
使用 .am-comments-list 包裹多个 .am-comment 即成评论列表。
给<ul>元素添加.am-comment-list类来创建一个评论列表。
4、 评论内容左右对齐:在评论列表 .am-comments-list 上增加 .am-comments-list-flip class,可以使左右交错的评论列表内容左右对齐(在 medium-up 区间有效)。
5、 评论状态(颜色):
.am-comment-flip在右边显示头像(原来头像在左边).am-comment-primary高亮评论(边框为主色).am-comment-highlight/.am-comment-highlight高亮评论(边框为次色).am-comment-success高亮评论(边框为绿色).am-comment-warning高亮评论(边框为橙色).am-comment-danger高亮评论(边框为红色)
二、评论列表Comment
Comment 评论组件
评论组件由用户头像、评论元信息、评论内容组成(有点似曾相识?没错,很像 Github 的评论列表)。
基本结构如下:
<article class="am-comment"> <!-- 评论容器 -->
<a href="">
<img class="am-comment-avatar" alt=""/> <!-- 评论者头像 -->
</a>
<div class="am-comment-main"> <!-- 评论内容容器 -->
<header class="am-comment-hd">
<!--<h3 class="am-comment-title">评论标题</h3>-->
<div class="am-comment-meta"> <!-- 评论元数据 -->
<a href="#link-to-user" class="am-comment-author">..</a> <!-- 评论者 -->
评论于 <time datetime="">...</time>
</div>
</header>
<div class="am-comment-bd">...</div> <!-- 评论内容 -->
</div>
</article>
其中 .am-comment-title 在使用中并不常见。
使用演示
单条评论
那,那是一封写给南部母亲的信。我茫然站在骑楼下,我又看到永远的樱子走到街心。其实雨下得并不大,却是一生一世中最大的一场雨。而那封信是这样写的,年轻的樱子知不知道呢?
妈:我打算在下个月和樱子结婚。
<article class="am-comment">
<a href="#link-to-user-home">
<img src="" alt="" class="am-comment-avatar" width="48" height="48"/>
</a>
<div class="am-comment-main">
<header class="am-comment-hd">
<!--<h3 class="am-comment-title">评论标题</h3>-->
<div class="am-comment-meta">
<a href="#link-to-user" class="am-comment-author">某人</a>
评论于 <time datetime="2013-07-27T04:54:29-07:00" title="2013年7月27日 下午7:54 格林尼治标准时间+0800">2014-7-12 15:30</time>
</div>
</header>
<div class="am-comment-bd">
...
</div>
</div>
</article>
评论列表
使用 .am-comments-list 包裹多个 .am-comment 即成评论列表。
给<ul>元素添加.am-comment-list类来创建一个评论列表。
<ul class="am-comments-list am-comments-list-flip">
<li class="am-comment">
...
</li>
<li class="am-comment">
...
</li>
...
<li class="am-comment am-comment-flip"></li>
<li class="am-comment am-comment-highlight"></li>
</ul>
评论内容左右对齐
在评论列表 .am-comments-list 上增加 .am-comments-list-flip class,可以使左右交错的评论列表内容左右对齐(在 medium-up 区间有效)。
谢谢大家的建议。并非所有使用场景都使用左右交错的列表,所以加了单独的 class,供用户选择。
评论状态
在容器上添加评论状态 class(演示见上面列表里的最后几条)。
.am-comment-flip在右边显示头像.am-comment-primary高亮评论(边框为主色).am-comment-highlight/.am-comment-highlight高亮评论(边框为次色).am-comment-success高亮评论(边框为绿色).am-comment-warning高亮评论(边框为橙色).am-comment-danger高亮评论(边框为红色)
<article class="am-comment am-comment-flip">
...
</article>
<article class="am-comment am-comment-flip">
...
</article>
<article class="am-comment am-comment-flip am-comment-highlight">
...
</article>
amazeui学习笔记--css(常用组件5)--评论列表Comment的更多相关文章
- amazeui学习笔记--css(常用组件6)--图标Icon
amazeui学习笔记--css(常用组件6)--图标Icon 一.总结 1.关注用法即可:在 HTML 上添加添加 am-icon-{图标名称} class. <span class=&quo ...
- amazeui学习笔记--css(常用组件16)--文章页Article
amazeui学习笔记--css(常用组件16)--文章页Article 一.总结 1.基本使用:文章内容页的排版样式,包括标题.文章元信息.分隔线等样式. .am-article 文章内容容器 .a ...
- amazeui学习笔记--css(常用组件15)--CSS动画Animation
amazeui学习笔记--css(常用组件15)--CSS动画Animation 一.总结 1.css3动画封装:CSS3 动画封装,浏览器需支持 CSS3 动画. Class 描述 .am-anim ...
- amazeui学习笔记--css(常用组件14)--缩略图Thumbnail
amazeui学习笔记--css(常用组件14)--缩略图Thumbnail 一.总结 1.基本样式:在 <img> 添加 .am-thumbnail 类:也可以在 <img> ...
- amazeui学习笔记--css(常用组件13)--进度条Progress
amazeui学习笔记--css(常用组件13)--进度条Progress 一.总结 1.进度条基本使用:进度条组件,.am-progress 为容器,.am-progress-bar 为进度显示信息 ...
- amazeui学习笔记--css(常用组件12)--面板Panel
amazeui学习笔记--css(常用组件12)--面板Panel 一.总结 1.面板基本样式:默认的 .am-panel 提供基本的阴影和边距,默认边框添加 .am-panel-default,内容 ...
- amazeui学习笔记--css(常用组件11)--分页Pagination
amazeui学习笔记--css(常用组件11)--分页Pagination 一.总结 1.分页使用:还是ul包li的形式: 分页组件,<ul> / <ol> 添加 .am-p ...
- amazeui学习笔记--css(常用组件10)--导航条Topbar
amazeui学习笔记--css(常用组件10)--导航条Topbar 一.总结 1. 导航条:就是页面最顶端的导航条:在容器上添加 .am-topbar class,然后按照示例组织所需内容.< ...
- amazeui学习笔记--css(常用组件9)--导航nav
amazeui学习笔记--css(常用组件9)--导航nav 一.总结 1.导航基本使用:<ul> 添加 .am-nav class 以后就是一个基本的垂直导航.默认样式中并没有限定导航的 ...
随机推荐
- php验证邮箱,手机号是否正确
function is_valid_email($email)//判断是不是邮箱的函数{ return preg_match('/^[a-zA-Z0-9._%-]+@([a-zA-Z0-9.-] ...
- Swift学习笔记(12)--数组和字典的复制
Swift中,数组Array和字典Dictionary是用结构来实现的,但是数组与字典和其它结构在进行赋值或者作为参数传递给函数的时候有一些不同. 并且数组和字典的这些操作,又与Foundation中 ...
- ios程序启动过程和UIWidnow介绍
一.iOS程序的完整启动过程(有storyboard) 1.先执行main函数,main内部会调用UIApplicationMain函数 2.UIApplicationMain函数里面做了什么事情: ...
- Intellij IDEA使用指南(持续更新)(转)
一.项目层面 1.Java开发工具IntelliJ IDEA导入项目 http://jingyan.baidu.com/article/a17d52852118ac8098c8f2c1.html 2. ...
- HDU 5375 Gray code(DP)
题意:给一串字符串,里面可能出现0,1,?,当中问号可能为0或1,将这个二进制转换为格雷码后,格雷码的每位有一个权值,当格雷码位取1时.加上该位权值,求最大权值和为多少. 分析:比赛的时候愚了.竟然以 ...
- 转:关于ios 推送功能的终极解决
刚刚做了一个使用推送功能的应用 遇到了一些问题整的很郁闷 搞了两天总算是弄明白了 特此分享给大家 本帖 主要是针对产品发布版本的一些问题 综合了网上一些资料根据自己实践写的 不过测试也可以看看 首先要 ...
- dlmalloc 2.8.6 源代码具体解释(5)
本文章由vector03原创, 转载请注明出处. 邮箱地址: mmzsmm@163.com, 欢迎来信讨论. 3. 分配及实现 本章节介绍dlmalloc的分配算法和实现.由于存在多mspac ...
- 设置select组件中的默认值
会员卡类型 <select id="name2" style="width:140px"> <option value="Ak& ...
- html --- rem 媒体查询
rem是一种相对长度单位,参考的基准是<html>标签定义的font-size. viewport 做移动端的h5,通常会在HTML文件中指定一个<meta>标签: <m ...
- 谈谈iframe的优缺点
iframe是一种框架,也是一种很常见的网页嵌入方式,零度今天给大家分析分析它的优缺点. iframe的优点: 1.iframe能够原封不动的把嵌入的网页展现出来. 2.如果有多个网页引用iframe ...