N
N
Nikita Kit2017-04-29 03:54:12
css
Nikita Kit, 2017-04-29 03:54:12

How to adequately lay out a list with an ellipsis between item?

Hello.
Recently, I was overtaken by such a setup in the layout:
11b4046314c44229bac43cfa2efe8b0c.png
I implemented this, of course, through the background-color set to the deepest text wrapper span. The trick is that on the next layout, the parent items alternate and you have to reassign the styles by setting the modifier in the table, since one table is on a white background, the other on a gray one.
87cb80dc47dc479c8f9e23c36d45088c.png
In advance (even before I realized that there was no border in the second layout =D) I put a crutch on coffee in order to reassign the color to the span.


cartable = ->
moduleName = 'cartable'
module = $ ".#{moduleName}"
carlistOdd = module.find ".carlist__autocard--#{moduleName}:nth-of-type(odd)"
carlistEven = module.find ". carlist__autocard--#{moduleName}:nth-of-type(even)"
modifyTable = (module, modificator)->
module.each ->
thisList = $ this
thisTable = thisList.find ".table"
thisTable.addClass "table- -#{modificator}"
modifyTable(carlistOdd, 'white')
modifyTable(carlistEven, 'gray')
module.exports = cartable;

And yet, academic interest torments me - is there a way to solve the issue with the layout of such a component without a rough fill of the top element? i.e. on css it’s all done somehow and put the crutch in the box ...
PS. I tried to google - in principle, they offer only the option that came to my mind ...
jsfiddle.net/L2ya3buj
codius.ru/articles/%D0%9A%D0%B0%D0%BA_%D1%81%D0%B2 ...
xiper.net/collect/html-and-css-tricks/content/tabl...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Danila, 2017-04-29
@ShadowOfCasper

https://codepen.io/DNLHC/pen/KmWrJe
although according to the specification the dd and dt tags cannot be wrapped, but I think the example is clear, I
redid it with a list

V
Vladimir, 2017-04-29
@ambrazhey

Optional pseudo-element with border-bottom: dotted

I
Ilya, 2017-06-24
@ilyapashkov02

I did this on flex, what do you do with underlining border-bottom: dotted and flex: 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question