·设为首页收藏本站📧邮箱修改🎁免费下载专区📒收藏夹👽聊天室📱AI智能体
返回列表 发布新帖

通用样式

579 1
发表于 2020-7-7 09:18:55 | 查看全部 阅读模式

马上注册,免费下载更多dz插件网资源。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
左右浮动
  1. .z { float: left; }.y { float: right; }
复制代码
清除浮动
  1. .cl { zoom: 1; }
复制代码

字号
  1. .xs1 { font-size: 12px !important; }.xs2 { font-size: 14px !important; }.xs3 { font-size: 16px !important; }
复制代码

字色
  1. .xg1 { color: LIGHTTEXT !important; } //浅色文字.xg2 { color: MIDTEXT; } //中等文本颜色.xi2 { color: HIGHLIGHTLINK !important; } //高亮链接颜色.rq { color: red; }
复制代码

文字粗细
  1. .xw0 { font-weight: 400; }.xw1 { font-weight: 700; }
复制代码

边框
  1. .bbda { border-bottom: 1px dashed COMMONBORDER; } //虚线.bbs { border-bottom: 1px solid COMMONBORDER !important; } //实线.mnw { clear: both; border-top: 1px solid #CCC; } //实线.bmw { border: 1px solid #D9D9D9; }
复制代码

去边框
  1. .bw0_all, .bw0_all th, .bw0_all td { border: none !important; }
复制代码

去边框去背景色
  1. .bw0 { border: none !important; }
复制代码

居中
  1. .vm { vertical-align: middle; }.hm { text-align: center; }
复制代码

鼠标样式
  1. .cur1 { cursor: pointer; }
复制代码

外边距
  1. .mtn { margin-top: 5px !important; }.mbn { margin-bottom: 5px !important; }.mtm { margin-top: 10px !important; }.mbm { margin-bottom: 10px !important; }.mtw { margin-top: 20px !important; }.mbw { margin-bottom: 20px !important; }
复制代码

内边距
  1. .ptn { padding-top: 5px !important; }.pbn { padding-bottom: 5px !important; }.ptm { padding-top: 10px !important; }.pbm { padding-bottom: 10px !important; }.ptw { padding-top: 20px !important; }.pbw { padding-bottom: 20px !important; }
复制代码

内边距
  1. .bm_c {padding: 10px;}
复制代码
我要说一句 收起回复
一花一世界,一叶一追寻。一曲一场叹,一生为一人。

评论1

AI智能体Lv.7 发表于 2025-3-20 13:24:51 | 查看全部
你提供的这些CSS样式类非常实用,适用于Discuz论坛或其他网站的开发。以下是对这些样式类的详细解释和使用场景的建议:

### 1. **左右浮动**
   - `.z { float: left; }`:将元素向左浮动。
   - `.y { float: right; }`:将元素向右浮动。

   **使用场景**:常用于布局中,比如将导航栏、侧边栏或内容块进行左右排列。

### 2. **清除浮动**
   - `.cl { zoom: 1; }`:通过设置`zoom: 1`来触发IE的`hasLayout`属性,常用于清除浮动。

   **使用场景**:在浮动元素后使用,防止父容器高度塌陷。

### 3. **字号**
   - `.xs1 { font-size: 12px !important; }`:设置字体大小为12px。
   - `.xs2 { font-size: 14px !important; }`:设置字体大小为14px。
   - `.xs3 { font-size: 16px !important; }`:设置字体大小为16px。

   **使用场景**:用于调整不同部分的文字大小,比如标题、正文、注释等。

### 4. **字色**
   - `.xg1 { color: LIGHTTEXT !important; }`:浅色文字。
   - `.xg2 { color: MIDTEXT; }`:中等文本颜色。
   - `.xi2 { color: HIGHLIGHTLINK !important; }`:高亮链接颜色。
   - `.rq { color: red; }`:红色文字。

   **使用场景**:用于区分不同重要性的文字,比如提示信息、链接、警告等。

### 5. **文字粗细**
   - `.xw0 { font-weight: 400; }`:正常字体粗细。
   - `.xw1 { font-weight: 700; }`:加粗字体。

   **使用场景**:用于强调某些文字,比如标题、重点内容等。

### 6. **边框**
   - `.bbda { border-bottom: 1px dashed COMMONBORDER; }`:底部虚线边框。
   - `.bbs { border-bottom: 1px solid COMMONBORDER !important; }`:底部实线边框。
   - `.mnw { clear: both; border-top: 1px solid #CCC; }`:顶部实线边框,并清除浮动。
   - `.bmw { border: 1px solid #D9D9D9; }`:整体实线边框。

   **使用场景**:用于分隔内容区域,比如表格、列表、区块等。

### 7. **去边框**
   - `.bw0_all, .bw0_all th, .bw0_all td { border: none !important; }`:去除所有边框。
   - `.bw0 { border: none !important; }`:去除边框。

   **使用场景**:用于去除默认的边框样式,比如表格、按钮等。

### 8. **居中**
   - `.vm { vertical-align: middle; }`:垂直居中。
   - `.hm { text-align: center; }`:水平居中。

   **使用场景**:用于对齐文本或元素,比如表格单元格内容、按钮文字等。

### 9. **鼠标样式**
   - `.cur1 { cursor: pointer; }`:将鼠标指针设置为手型。

   **使用场景**:用于可点击的元素,比如按钮、链接等。

### 10. **外边距**
   - `.mtn { margin-top: 5px !important; }`:上边距5px。
   - `.mbn { margin-bottom: 5px !important; }`:下边距5px。
   - `.mtm { margin-top: 10px !important; }`:上边距10px。
   - `.mbm { margin-bottom: 10px !important; }`:下边距10px。
   - `.mtw { margin-top: 20px !important; }`:上边距20px。
   - `.mbw { margin-bottom: 20px !important; }`:下边距20px。

   **使用场景**:用于调整元素之间的间距,比如段落、图片、区块等。

### 11. **内边距**
   - `.ptn { padding-top: 5px !important; }`:上内边距5px。
   - `.pbn { padding-bottom: 5px !important; }`:下内边距5px。
   - `.ptm { padding-top: 10px !important; }`:上内边距10px。
   - `.pbm { padding-bottom: 10px !important; }`:下内边距10px。
   - `.ptw { padding-top: 20px !important; }`:上内边距20px。
   - `.pbw { padding-bottom: 20px !important; }`:下内边距20px。
   - `.bm_c {padding: 10px;}`:上下左右内边距均为10px。

   **使用场景**:用于调整元素内部内容与边框的间距,比如按钮、输入框、区块等。

### 总结
这些CSS样式类可以极大地简化Discuz论坛或其他网站的开发工作,尤其是在需要快速调整布局、样式时。通过合理使用这些类,可以保持代码的简洁性和一致性,同时提高开发效率。

如果你有更多关于Discuz开发的问题,欢迎随时提问!
-- 本回答由 人工智能 AI智能体 生成,内容仅供参考,请仔细甄别。
我要说一句 收起回复

回复

 懒得打字嘛,点击右侧快捷回复【查看最新发布】   【应用商城享更多资源】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

AI智能体
投诉/建议联系

discuzaddons@vip.qq.com

未经授权禁止转载,复制和建立镜像,
如有违反,按照公告处理!!!
  • 联系QQ客服
  • 添加微信客服

联系DZ插件网微信客服|最近更新|Archiver|手机版|小黑屋|DZ插件网! ( 鄂ICP备20010621号-1 )|网站地图 知道创宇云防御

您的IP:18.222.99.206,GMT+8, 2025-4-20 14:21 , Processed in 0.509825 second(s), 74 queries , Gzip On, Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2025 Discuz! Team.

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表