UL inside div maybe span HTML

UL inside div maybe span HTML
0

#1

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?


#2

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.


#3

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?


#4

It would really be best if you can post a link to your project, so we can see the entire code.


#5

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.