简体   繁体   English

如何在自适应中折叠列表项的边界

[英]How collapse borders of list-items in adaptive

Example jsfiddle: https://jsfiddle.net/bf4kncdh/1/ 示例jsfiddle: https ://jsfiddle.net/bf4kncdh/1/

.top-nav is element which have list of elements which i want to borders collapse. .top-nav是包含我想边框折叠的元素列表的元素。 In desktop i have menu items in 1 line, but in the adaptive they are lined up in several rows and the borders between the rows become thicker, and 1 element of the next row does not have a left border. 在桌面上我有1行菜单项,但在自适应中,它们排成几行,行之间的边框变粗,下一行的1个元素没有左边框。

I need them to have all the borders on the sides, like the fact that they would be the same width, standing next to each other. 我需要它们在两侧各有边框,就像它们的宽度相同,彼此相邻。

Is there any way to make boundaries like this, leaving the html markup the same? 有没有办法像这样制作边界,让html标记保持不变?

I find best way to solve this problem. 我找到了解决这个问题的最佳方法。 It based on outline and little margin 's properties to compensate double width border on neighbour list-items. 它基于outline和小margin的属性来补偿邻居列表项的双宽度边界。

https://jsfiddle.net/bf4kncdh/2/ https://jsfiddle.net/bf4kncdh/2/

That's is solution. 那是解决方案。

.main-nav ul li {
  outline: 1px solid #fff;
  margin-top: 1px;
  margin-right: 1px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM