UL inside div maybe span HTML

Error: Element div not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)

In my opinion in the UL is good to use div is working but in validator NOT. We know why display: inline-block vs display block. but the code where know that if my div is set to absolute? so this is valid I think because not use div inside UL as checker understand IT.

Is valid still?

Can we see the code?

AFAIK, the only valid child of a ul is an li. Period. Now, you could have a div as a child of the li, making the div the grandchild of the ul. But if you are trying to make a div the direct child of a ul, then you are misusing one or the other. There is another way to do what you’re doing that will use these elements the way they were intended. Please show us the code and explain what you want it to do.

I have the following

ul
li a img /a /li
li a img /a /li
li a img /a /li
li a img /a /li
With this I have images and on it links

This is a carousel slider I need two another li elements with a tag whitch is control the next and prev button something like

li div a control_prev /a /div /li
li div a control_next /a /div /li

Why i need div? inside control a tags? because caroseul slide from > li so that means all li elements will be slider so i cant stay without div because this way carosel not working as its embedd next and prev button.

What can do with it? Any opinions?

You don’t. I was responding to what you said. I don’t see the problem with what you have, except that I don’t see a closing </ul>

Beyond that, do as Randell says and show us your actual code, please. Please show us your code, tell us what you want it to do, and tell us what it is doing instead.