For a website I have created a mega menu. containing about 50 categories. I use column-count in order to devide the categories over the dropdown menu cSS
This is workg great from on laptop and up but on smaller devices the columns start to overlap eachother. What can I do to avoid that?
Edit: when using column-count and column-width on an article or div when the screen becomes to small for the number of columns the remaining columns will wrap below the other columns but with the dropdow that isn’t happening
@coothead. Thank you for the reply. That’s what I did. Not with as many breakpoints as you did, just with one to test but it didn’t give me the desired result. Maybe I need to clear the cashe. I will try that and keep you informed
Another approach to CSS columns which I like to use is to set a column-width.
This can avoid the need for all those @queries.
Shorthand syntax can set the (max) column count and width in one go.
.list {
columns: 5 10em ;
}
This will give you 5 columns where space allows. But as space reduces, if the columns get squeezed any smaller than the (10em) width you set, it will automatically drop the column count to 4, then 3 and so on…
@SamA74. Thank you for the reply. I had it like that before the suggestion from @coothead and before clearing the cache. For now I’m done but I will give that approach another try tommorow. I will keep you updated. Again thanx a lot
Yes it is. But the media query approach, as suggested by @coothead, wasn’t working in the first place either untill I cleared the cache, after which it worked. I’m sure that in the same way the column-width should work as well. I will post the result after I have tested it tomorrow