overflow:hidden 影响inline-block元素周围元素下移

探讨了当一个inline-block元素设置overflow:hidden属性时,如何影响其基线(baseline)位置,导致与相邻文字不对齐的问题。通过分析CSS规范,提供了两种解决方案:调整vertical-align属性或匹配line-height。

前言:

最近在切页中,我想实现左边一个类似下拉选框,且不允许输入,右边有一段垂直居中的文字描述的效果。我对文字用的是p标签。其实可以用个i/b/em等其他行内标签,同时也具有一定语义,做为强调提示,(当时事实证明用行内标签问题一样存在)。最后我的问题出现了。一个设置了overflow:hidden 的inline-block元素旁边的文字与边框的下边放佛是对齐的。因为vertical-align属性的默认值时baseline,同是文字又只有一行那么它们的baseline应该是对齐的啊!!     

当修改元素的vertical-align属性为baseline以外的其他值时可以看到文字相对边框的垂直位置发生了变化。初步能确定是跟对齐方式有关,并且是由于基线(baseline)的位置发生了变化而不再是原来的以x的下边线做为基线了。那么是什么原因造成位置的偏移呢?经过测试,发现是overflow:hidden的这个属性影响了inline-block元素baseline的位置。那么overflow:hidden的inline-block元素的baseline怎样设置的呢?请继续往下读......

问题描述:

overflow:hidden怎样影响inline-block的baseline的位置。导致文字不与inline-block的文字的对齐,而是向下偏移。

 

化繁为简,代码如下,效果运行请看demo

html结构

<div class="div1">
  我是div1
</div>
<div class="div2">
  我是div2
</div>

css 样式

.div1 ,
.div2 {
	display: inline-block;
}
.div1 {
	width: 180px;
    height: 40px;
    line-height: 40px;
    overflow: hidden;
    border: 1px solid #000;
}

  

 

div2和左边的框中间没对齐。 默认对齐方式是baseline.

原因:

vertical-align的默认值是baseline。当div1 设置了属性overflow:hidden后,baseline会设置在bottom margin的边缘。详情戳css规范

规范的截图:

翻译:'inline-block'(盒)的基线是它的最后一个常规流中的行盒的基线除非它没有流内行盒或者它的'overflow'属性的计算值不为'visible',此时基线是bottom margin边。

 

所以div2的文字和div1的下边框对齐。

 

注意:如果元素内部只有脱离常规流的行盒,如被设置了float 除了none以外的值,position为fixed和absolute,也会出现同样的情况。demo

解决方案:

方案1.将设置了overflow:hidden的元素 的垂直对齐方式设置为vertical:middle;将该盒的竖直中点与父级元素的baseline对齐。demo2.

 

此方案需要写的代码少,当它周围有其他元素的时候,也能解决。 兼容问题,在支持inline-block的浏览器中都支持。想要ie 6,7兼容可以触发haslayout,并将元素用ie6、7的hack设为inline盒模型。使其表现出inline-block的特性。

代码如下:

.div1,
.div2 {
  display: inline-block;
  *display: inline;  /*ie7及以下浏览器 以内联盒模型渲染*/
  *zoom: 1;   /*触发ie的haslayout*/
}
.div1 {
  width: 180px;
  height: 40px;
  line-height: 40px;
  overflow: hidden;
  border: 1px solid #000;
  vertical-align: middle;
}

  

方案2. 稍微麻烦点,对受影响的另一个inline-block的元素处理,让它的line-height和div1的height相同。并且让自己的垂直对齐方式为vertica-align:middle;   demo3

 

.div1,
.div2 {
  display: inline-block;
  *display: inline;  /*ie7及以下浏览器 以内联盒模型渲染*/
  *zoom: 1;   /*触发ie的haslayout*/
}
.div1 {
  width: 180px;
  height: 40px;
  line-height: 40px;
  overflow: hidden;
  border: 1px solid #000;
  vertical-align: middle;
}
.div2 {
 line-height: 40px;
 vertical-align: top;
}

 此方法,只是让它看起来在旁边盒子的垂直中点位置,且如果旁边的元素比较多,要为这些元素一一设置属性。不建议使用。

 延伸问题:

如果inline-block元素旁边的是inline元素,有同样的影响吗?

答案是 yes ,请看demo4,原因也是同上。

 关于baseline 怎么确定,规范上没有具体定义,user agent自己规定。

以下摘自w3c规范

内联格式化上下文节所述,用户代理把内联级盒排列在一个行盒的垂直堆叠里。行盒的高度由下列规则决定:

  1. 计算行盒中每个内联级盒的高度时,对于可替换元素,inline-block元素和inline-table元素,这个值就是其margin box的高度;对于内联盒,这个值是其'line-height'(见“计算height与margin”“行距(Leading)与半行距”中的内联盒的高度
  2. 内联级盒是根据其'vertical-align'属性竖直对齐的。如果它们是'top'或者'bottom'对齐,它们必须对齐得让行盒高度最小化。如果这样的盒足够高,存在多个解,而CSS 2.1没有定义行盒基线的位置(即,strut的位置,见下文)
  3. 行盒高度是最高的盒的top与最低的盒的bottom之间的距离(包括下面'line-height'中解释的strut

空内联元素生成空的内联盒,但这些盒仍然具有margin,padding,border和line height,并因此会影响这些计算,就像有内容的元素一样。

 

 补充 strut:对于一个内容由内联级元素组成的块容器元素,'line-height'指定了元素内行盒的最小高度。这个最小高度包含基线上方的最小高度和下方的最小深度,就像每个行盒以一个具有该元素的字体和行高属性的0宽内联盒开始。我们把这种假想盒叫做"strut"(这个名字是受TeX的启发)。  

 

参考资料:

https://www.w3.org/TR/CSS2/visudet.html#strut

http://blog.youkuaiyun.com/iefreer/article/details/50421025

转载于:https://www.cnblogs.com/AliceX-J/p/5731755.html

<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>产品展示画廊</title> <style> .gallery-container { display: flex; flex-wrap: wrap; gap: 30px; max-width: 90%; margin: 0 auto; padding: 20px; background: #fff; /* 移除外框阴影 */ border-radius: 10px; } .gallery-section { flex: 1; min-width: 40%; } .description-section { flex: 1; min-width: 40%; padding: 20px; background: #fff; border-radius: 8px; /* 减小整体字体大小 */ font-size: 14px; } /* 添加标题样式 */ .section-title { font-size: 2.0em; /* 比正文稍大但比原设计小 */ font-weight: bold; color: #0566a8; margin-top: 0; padding-bottom: 0px; /*border-bottom: 1px solid #eee;*/ margin-bottom: 0px; } /* 添加联系按钮样式 */ .contact-button { display: inline-block; margin-top: 20px; padding: 10px 20px; background-color: #0566a8; color: white; text-decoration: none; border-radius: 4px; font-weight: 500; transition: all 0.3s ease; border: none; cursor: pointer; font-size: 16px; text-align: center; width: 100%; box-sizing: border-box; } .contact-button:hover { background-color: #034a7a; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); } .main-image { width: 100%; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); cursor: pointer; transition: transform 0.3s; } .main-image:hover { transform: scale(1.01); } .thumbnails { display: flex; justify-content: center; gap: 10px; margin-top: 15px; overflow-x: auto; padding: 10px 0; } .thumbnail { width: 70px; height: 70px; border-radius: 5px; cursor: pointer; object-fit: cover; border: 2px solid transparent; transition: all 0.3s; opacity: 0.7; } .thumbnail:hover, .thumbnail.active { opacity: 1; border-color: #0566a8; transform: scale(1.05); } /* 居中模态框样式 */ .modal { display: none; position: fixed; z-index: 1000; top: 0; left: 10%; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9); overflow: auto; } .modal-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 80%; max-height: 80%; object-fit: contain; border-radius: 5px; box-shadow: 0 0 30px rgba(0,0,0,0.6); } /* 导航按钮样式 */ .nav-btn { position: fixed; top: 50%; transform: translateY(-50%); color: white; font-size: 40px; cursor: pointer; background: rgba(0,0,0,0.3); width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; border-radius: 50%; z-index: 1002; transition: all 0.3s; } .nav-btn:hover { background: rgba(0,0,0,0.6); transform: translateY(-50%) scale(1.1); } .prev-btn { left: 12%; } .next-btn { right: 12%; } .close { position: fixed; top: 5%; right: 12%; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; transition: 0.3s; z-index: 1001; background: rgba(0,0,0,0.3); width: 50px; height: 50px; display: flex; justify-content: center; align-items: center; border-radius: 50%; } .close:hover { color: #bbb; background: rgba(0,0,0,0.6); transform: scale(1.1); } .feature-list { margin: 0; padding-left: 20px; /* 减小列表字体大小 */ font-size: 0.95em; } .feature-list li { margin-bottom: 10px; position: relative; } .feature-list li::before { content: "•"; color: #3498db; position: absolute; left: -15px; font-size: 1.2em; } @media (max-width: 768px) { .gallery-container { flex-direction: column; max-width: 95%; } .thumbnails { justify-content: flex-start; } .nav-btn { width: 40px; height: 40px; font-size: 24px; } .close { font-size: 30px; width: 40px; height: 40px; } .section-title { font-size: 1.2em; } } </style> </head> <body> <div class="gallery-container"> <!-- 左侧图片画廊 --> <div class="gallery-section"> <img id="mainImage" class="main-image" src="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月9日-11_40_06_compressed.png" alt="图集"> <div class="thumbnails"> <img class="thumbnail active" src="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月9日-11_40_06_compressed.png" alt="图一" data-large="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月9日-11_40_06_compressed.png"> <img class="thumbnail" src="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月10日-11_05_58_compressed.png" alt="图二" data-large="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月10日-11_05_58_compressed.png"> <img class="thumbnail" src="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月10日-11_38_09_compressed.png" alt="图三" data-large="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月10日-11_38_09_compressed.png"> <img class="thumbnail" src="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月10日-13_55_14_compressed.png" alt="图四" data-large="https://www.fetchingpack.com/wp-content/uploads/2025/07/ChatGPT-Image-2025年6月10日-13_55_14_compressed.png"> </div> </div> <!-- 右侧文字描述 - 添加了标题 --> <div class="description-section"> <!-- 添加的标题 --> <h2 class="section-title">collapsible rigid box</h2> <div class="description-content"> <ul class="feature-list"> <li>We offer collapsible rigid boxes in three sizes—Large, Medium, and Tiny,each a proprietary structure we developed in-house and protected by our patents.<br>Image 1- Large:Suitable for magnetic gift boxes with product height of 100-150mm.<br>Image 2- Medium:Suitable for magnetic gift boxes with product height of 50-100mm.<br>Image 3- Tiny:Suitable for magnetic gift boxes with product height of 20-50mm.</li> <li>Our collapsible rigid box, can save more than 60% of shipping and storage costs compared with rigid gift box,save 20%-30% costs compared with standard collapsible rigid box.</li> <li>Can be apply cold or hot foil stamping, UV, frosted touch, embossing and other surface processes to enhance the overall packaging visual effect.</li> <li>Using automatic visual positioning boxes production line, short production time and stable quality.</li> <li>FSC certified material, environmentally friendly and recyclable.</li> </ul> <!-- 添加的联系按钮 --> <a href="https://www.fetchingpack.com/contact-us/" class="contact-button">Contact Us</a> </div> </div> </div> <!-- 图片模态框 --> <div id="imageModal" class="modal"> <span class="close">×</span> <div class="prev-btn nav-btn">❮</div> <div class="next-btn nav-btn">❯</div> <img class="modal-content" id="expandedImage"> </div> <script> // 获取DOM元素 const mainImage = document.getElementById('mainImage'); const thumbnails = document.querySelectorAll('.thumbnail'); const modal = document.getElementById('imageModal'); const expandedImg = document.getElementById('expandedImage'); const closeBtn = document.querySelector('.close'); const prevBtn = document.querySelector('.prev-btn'); const nextBtn = document.querySelector('.next-btn'); // 当前选中的图片索引 let currentIndex = 0; // 缩略图点击事件 thumbnails.forEach((thumb, index) => { thumb.addEventListener('click', function() { // 更新主图 updateMainImage(this.dataset.large, this.alt); // 更新当前索引 currentIndex = index; // 更新激活状态 thumbnails.forEach(t => t.classList.remove('active')); this.classList.add('active'); }); }); // 更新主图函数 function updateMainImage(src, alt) { mainImage.src = src; mainImage.alt = alt; } // 主图点击事件 - 打开模态框 mainImage.addEventListener('click', function() { openModal(this.src, this.alt); }); // 打开模态框函数 function openModal(src, alt) { modal.style.display = 'block'; expandedImg.src = src; expandedImg.alt = alt; document.body.style.overflow = 'hidden'; // 防止背景滚动 } // 关闭模态框函数 function closeModal() { modal.style.display = 'none'; document.body.style.overflow = ''; // 恢复背景滚动 } // 关闭按钮点击事件 closeBtn.addEventListener('click', closeModal); // 点击模态框背景关闭 modal.addEventListener('click', function(e) { if (e.target === modal) { closeModal(); } }); // ESC键关闭模态框 document.addEventListener('keydown', function(e) { if (e.key === 'Escape' && modal.style.display === 'block') { closeModal(); } }); // 上一张按钮 prevBtn.addEventListener('click', function(e) { e.stopPropagation(); // 防止触发背景关闭 navigate(-1); }); // 下一张按钮 nextBtn.addEventListener('click', function(e) { e.stopPropagation(); // 防止触发背景关闭 navigate(1); }); // 键盘左右键导航 document.addEventListener('keydown', function(e) { if (modal.style.display !== 'block') return; if (e.key === 'ArrowLeft') { navigate(-1); } else if (e.key === 'ArrowRight') { navigate(1); } }); // 导航函数 function navigate(direction) { currentIndex += direction; // 循环处理 if (currentIndex < 0) { currentIndex = thumbnails.length - 1; } else if (currentIndex >= thumbnails.length) { currentIndex = 0; } // 获取新的缩略图 const newThumb = thumbnails[currentIndex]; // 更新模态框中的图片 expandedImg.src = newThumb.dataset.large; expandedImg.alt = newThumb.alt; // 更新激活状态 thumbnails.forEach(t => t.classList.remove('active')); newThumb.classList.add('active'); // 更新主图 updateMainImage(newThumb.dataset.large, newThumb.alt); } // 添加触摸滑动支持 let touchStartX = 0; expandedImg.addEventListener('touchstart', (e) => { touchStartX = e.touches[0].clientX; }); expandedImg.addEventListener('touchend', (e) => { const touchEndX = e.changedTouches[0].clientX; const diffX = touchStartX - touchEndX; if (Math.abs(diffX) > 50) { // 滑动距离阈值 if (diffX > 0) { navigate(1); // 向左滑动,下一张 } else { navigate(-1); // 向右滑动,上一张 } } }); </script> </body> </html> 如何缩短标题和文本之间的距离
07-24
根据下面的页面代码,需要编写这个js点击事件,点击明细表中每行的name为extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)的输入框,能跳转到对应这个输入框的value里面的链接地址,页面代码如下:<tr> <td row="2" column="0,1,2,3" class="td_normal_title" colspan="4" style="width: auto;" width="undefined"> <script> $(function() { var tb = document.getElementById('TABLE_DL_fd_3e59465a09231a'); tb.setAttribute('tbdraggable', 'true'); }); </script> <script> Com_IncludeFile('doclist.js'); </script> <script id="doclist_js" src="/resource/js/doclist.js?s_cache=1754870647847"></script> <script id="doclistdnd_js" src="/resource/js/doclistdnd.js?s_cache=1754870647847"></script> <script> DocList_Info.push('TABLE_DL_fd_3e59465a09231a'); </script> <script> Com_IncludeFile('detailsTableFreeze.css', Com_Parameter.ContextPath + 'sys/xform/designer/resource/css/', 'css', true); </script> <link rel="stylesheet" href="/sys/xform/designer/resource/css/detailsTableFreeze.css?s_cache=1754870647847"> <script> Com_IncludeFile('detailsTableFreeze.js', Com_Parameter.ContextPath + 'sys/xform/designer/resource/js/', 'js', true); </script> <script id="detailsTableFreeze_js" src="/sys/xform/designer/resource/js/detailsTableFreeze.js?s_cache=1754870647847"></script> <script> Com_AddEventListener(window, 'load', function() { setTimeout(function() { for (var i = 0; i < 1; i++) { DocList_AddRow(document.getElementById('TABLE_DL_fd_3e59465a09231a')) }; tableFreezeStarter('TABLE_DL_fd_3e59465a09231a', false, undefined, false, true, 'add'); }, 500); }); </script> <table label="明细表1" id="TABLE_DL_fd_3e59465a09231a" align="center" class="tb_normal" tablename="fd_3e5946528a2834" style="width: 100%;" data-multihead="false" width="100%" showindex="true" showrow="1" showstatisticrow="undefined" showcopyopt="undefined" dataentrymode="multipleRow" required="undefined" performance="undefined" excelexport="undefined" excelimport="undefined" defaultfreezetitle="undefined" defaultfreezecol="undefined" layout2col="undefined" fd_type="detailsTable" tbdraggable="true"> <tbody> <tr class="tr_normal_title" type="titleRow" style="height: 33px;" invalidrow="true"> <td row="1" column="0" align="center" coltype="selectCol" style="width: 15px;"></td> <td row="0" column="1" align="center" class="td_normal_title" coltype="noTitle" style="width: 25px; white-space: nowrap;">序号</td> <td row="0" column="2" align="center" class="td_normal_title"> <label class="xform_label" line="normal" fd_type="textLabel" style="display: inline-block; width: auto; word-break: break-all; overflow-wrap: break-word;;word-break:break-all;;word-wrap:break-word;">文本1</label> </td> <td row="0" column="3" align="center" class="td_normal_title"> <label class="xform_label" line="normal" style="display: inline-block; width: auto; word-break: break-all; overflow-wrap: break-word;;word-break:break-all;;word-wrap:break-word;" fd_type="textLabel">文本3</label> </td> <td row="0" column="4" align="center" class="td_normal_title"></td> <td row="0" column="5" align="center" class="td_normal_title" coltype="blankTitleCol" style="width:48px;"></td> </tr> <tr class="" trdraggable="true" style="cursor: move; user-select: none;"> <td class="" align="center" valign=""><input type="checkbox" name="DocList_Selected" onclick="DocList_SelectRow(this);"></td> <td class="" align="center" valign="">1</td> <td class="" align="center" valign=""> <div class="xform_inputText" canshow="true" fd_type="inputText" style="display: inline-block; width: 147px; word-break: break-all; overflow-wrap: break-word;"> <xformflag flagid="fd_3e59465a09231a.0.fd_3e59465b4a38ce" id="_xform_extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e59465b4a38ce)" property="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e59465b4a38ce)" flagtype="xform_text" _xform_type="text"><input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e59465b4a38ce)" subject="文本1" title="文本1" onblur="__xformDispatch(this.value, this);" class="inputsgl xform_inputText" value="" type="text" style="display: inline-block; width: 147px; word-break: break-all; overflow-wrap: break-word;width:120px;"> </xformflag> </div> <input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fdId)" value="" type="hidden"> </td> <td class="" align="center" valign=""> <div style="display: inline-block; width: 202px;width: 210px;" class="xform_formula_load"> <xformflag flagid="fd_3e59465a09231a.0.fd_3e5946689e29d2" id="_xform_extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)" property="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)" flagtype="formula_calculation" _xform_type="formulaCalculation"> <script> Com_IncludeFile('formula_calculation_script.js', '../sys/xform/designer/formula_calculation/'); </script> <script id="formula_calculation_script_js" src="/resource/../sys/xform/designer/formula_calculation/formula_calculation_script.js?s_cache=1754870647847"> </script> <input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)" value="http://192.1.1.92:8080/webroot/decision/view/duchamp?viewlet=crm_project%252F%25E7%2589%25A9%25E6%2596%2599%25E4%25BE%259B%25E9%259C%2580%25E6%259F%25A5%25E8%25AF%25A2%25E9%25A1%25B5%25E9%259D%25A2.fvs&ref_t=design&ref_c=1e33972c-8151-43ff-81bb-d263b846af18&page_number=1&p_material=123" type="hidden" loadtype="autoLoad,manualLoad"><input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2_text)" subject="文本3" title="文本3" formula_calculation="true" isrow="true" returntype="text" loadtype="autoLoad,manualLoad" controlsid="fd_3e59465a09231a.fd_3e59465b4a38ce" fdid="fd_3e59465a09231a.0.fd_3e5946689e29d2" right="" readonly="readOnly" class="inputsgl xform_formula_load" value="" type="text" style="display: inline-block; width: 202px;width: 200px;"> </xformflag> </div> </td> <td class="" align="center" valign=""> <label class="xform_linkLabel" fd_type="linkLabel" style="display: inline-block; "><a target="_blank" href="www.baidu.com" style="color: rgb(66, 133, 244); font-weight: normal; font-style: normal; text-decoration: none;" parent_style="display: inline-block; width: 58px;" parent_class="xform_linkLabel">超链接1 </a></label> </td> <td class="" align="center" valign=""> <nobr><span style="cursor:pointer" class="optStyle opt_copy_style" title="复制行" onmousedown="DocList_CopyRow();"></span>  <span style="cursor:pointer" class="optStyle opt_del_style" title="删除行" onmousedown="DocList_DeleteRow_ClearLast();XFom_RestValidationElements();"></span>   </nobr> </td> </tr> <tr type="statisticRow" invalidrow="true"> <td row="1" column="0" align="center" coltype="selectCol" style="width: 15px;"></td> <td row="2" column="1" align="center" coltype="noFoot" style="width: 25px;"> </td> <td row="2" column="2" align="center"> </td> <td row="2" column="3" align="center"> </td> <td row="2" column="4" align="center"> </td> <td row="2" column="5" align="center" coltype="emptyCell" style="width: 48px;"> </td> </tr> <tr type="optRow" class="tr_normal_opt" invalidrow="true"> <td row="3" column="0" align="center" coltype="optCol" colspan="6" style=""> <div class="tr_normal_opt_content" style="min-width:580px;;"> <div class="tr_normal_opt_l"><label class="opt_ck_style" style="position:relative;top:3px;"><input type="checkbox" name="DocList_SelectAll" onclick="DocList_SelectAllRow(this);"><span style="margin-left: 6px;">全选<span></span></span></label><span style="margin-left:15px;" onclick="DocList_BatchDeleteRow();XFom_RestValidationElements();"><span class="optStyle opt_batchDel_style" style="margin-left:0px; " title="删除行"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">删除行</span></span> </div> <div class="tr_normal_opt_c"><span onclick="DocList_AddRow();XFom_RestValidationElements();"><span class="optStyle opt_add_style" title="添加行"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">添加行</span></span><span style="margin-left:15px;" onclick="DocList_MoveRowBySelect(-1);"><span class="optStyle opt_up_style" title="上移"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">上移</span></span><span style="margin-left:15px;" onclick="DocList_MoveRowBySelect(1);"><span class="optStyle opt_down_style" title="下移"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">下移</span></span> </div> <div class="tr_normal_opt_r"> </div> </div> </td> </tr> </tbody> </table> </td> </tr>
08-13
<template id="login_navbar" inherit_id="website.layout" name="Login Page Navigation"> <xpath expr="//header" position="before"> <nav class="custom-login-nav" style="background:#000;border-bottom:1px solid #eee;padding:10px 0;position:fixed;top:0;left:0;width:100%;z-index:1099;"> <div style="margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:0 15px;"> <div> <small> <span style="font-weight:bold;font-size:15px;color:#7c6e7f;text-decoration:none;"> 欢迎访问Odoo亚太地区金牌服务机构·开源智造(OSCG)</span> <span style="" class="text-white"> <b>&nbsp;</b> </span> </small> <a href="tel:400-900-4680" data-original-title="" title="" aria-describedby="tooltip383200"> <small> <b data-original-title="" title="" aria-describedby="tooltip932940"> <i class="fa fa-1x fa-fw fa-phone ml-3 mr-2 text-white" style="" data-original-title="" title="" aria-describedby="tooltip873223" /> <font style="font-size: 12px;color:#fff;">400-900-4680&nbsp;</font> </b> </small> </a> <a href="mailto:sales@oscg.cn" data-original-title="" title="" aria-describedby="tooltip722417"> <small> <i class="fa fa-1x fa-envelope fa-fw ml-3 mr-2 text-o-color-3" style="font-size: 12px;" data-original-title="" title="" aria-describedby="tooltip553776" /> <font style="" class="text-o-color-4" data-original-title="" title="" aria-describedby="tooltip42618"><b>sales@oscg.cn</b>&nbsp;</font> </small> </a> </div> <div style="color:#fff;"> <div class="no_icon_color s_share" data-name="Social Media"> <small class="s_share_title text-muted"> <span style="font-size: 14px;" class="text-o-color-4"> <b>Language/语言</b> </span> <span style="font-size: 14px;"> <b>:</b> </span> <span style="font-size: 11.2px;"> <b> </b> </span> </small> <img src="/website_login_nav/static/src/img/cn.png" style="width:20px;height:14px;vertical-align:middle;margin-right:5px;" /> &nbsp;<font style="font-size: 12px;"> <b><a href="http://www.oscg.cn/" data-original-title="" title="" style="color:#fff;"> 简体中文&nbsp;</a> &nbsp; &nbsp;&nbsp;</b> </font> <img src="/website_login_nav/static/src/img/us.png" style="width:20px;height:14px;vertical-align:middle;margin-right:5px;" /> &nbsp;<span style="display: inline !important; font-size: 12px;"> <b><a href="http://www.oscg.com.hk" data-original-title="" title="" style="color:#fff;" aria-describedby="tooltip75929">English</a>&nbsp; &nbsp; &nbsp;&nbsp;</b> </span> <!-- <img src="/website_login_nav/static/src/img/jp.png" style="width:20px;height:14px;vertical-align:middle;margin-right:5px;" /> &nbsp;<span style="display: inline !important; font-size: 12px;"> <b><a href="http://www.oscg.com.hk" data-original-title="" title="" style="color:#fff;" aria-describedby="tooltip75929">日本語</a>&nbsp; &nbsp; &nbsp;&nbsp;</b> </span> --> <span style="font-size: 0.875rem; display: inline !important;">&nbsp;</span> </div> </div> </div> </nav> </xpath> <!-- 为wrapwrap添加上边距 --> <xpath expr="//div[@id='wrapwrap']" position="attributes"> <attribute name="style">padding-top: 110px;</attribute> </xpath> </template>可以实现在header顶部,但是手机端的会把header遮挡住,应该如何修改才可以变为odoo的定制模块‘
08-12
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值