DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: cuiqingbo
今日帖子: 20
在线用户: 12
导航: 论坛 -> Web应用开发 斑竹:bodies  
作者:
男 dmzn (dmzn) ★☆☆☆☆ -
盒子活跃会员
2021/9/3 0:43:06
标题:
uniGUI: 通过css设置Panel的四个边框 浏览:1542
加入我的收藏
楼主: 有时候需要去掉Panel的某些边框,实现方法是将边框的border-color置为透明。方法如下:
1.在ServerModule.CustomCSS编写css配置:
  .x-panel-border-none /*border: none*/
  {
   border-color:transparent transparent transparent transparent;
   /*顺序: 上 右 下 左*/
  }
  .x-panel-border-topbottom /*border: top bottom*/
  {
   border-color:#99bbe8 transparent #99bbe8 transparent;
  }
  .x-panel-border-leftright /*border: left right*/ 
  {
   border-color:transparent #99bbe8 transparent #99bbe8;
  }
2.设置Panel的边框样式
  LayoutConfig.BodyCls = 'x-panel-border-topbottom'
  
以下说明来自官方论坛的讨论:
1)The same css code in customFiles  and customCSS ,wich code will take effect?
  It is based on the css code. For example if you have "!important" in one 
  of them, it will take effect.

2)LayoutConfig.Cls will take effect correspording to customCSS,what is the 
  difference between LayoutConfig.BodyCls and LayoutConfig.Cls?
  BodyCls will apply the css class to body of the component. cls will apply 
  to very top and it will effect all inherited html elements.
----------------------------------------------
生活愉快.
作者:
男 dmzn (dmzn) ★☆☆☆☆ -
盒子活跃会员
2021/9/3 0:44:49
1楼: 运行时使用代码设置css样式:
with Splitter1.J SInterface do
begin
  J SConfig('border', [true]);
  J SConfig('bodyBorder', [True]);
  //设置组件的属性

  J SCall('setStyle', ['border-style', 'solid none dashed none']); //通过代码设置样式
  //J SCall('setStyle', ['border-color', '#99bbe8 transparent #99bbe8 transparent']);
  J SCall('addCls', ['x-panel-border-topbottom']); //通过CustomCSS设置样式
end;
  
推荐将css存放在外部文件,配置变更时便于修改,无需重新编译代码。
----------------------------------------------
生活愉快.
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行70.3125毫秒 RSS