CSS WIld Cards
Posted on 2016-09-26
I need to select a DIV to add a padding-top to and it's id is dynamic. I know that it will end with _TopNavigationMenu, but the prefix seems random and so I need to have a wildcard to select it in a style sheet.
In this case the searched for string is part of an id. But in other cases I have to do similar where the searched string is part of a class name.
In jQuery it would be something like this for the id search: $('div[id$="TopNavigationMenu"]').attr('style','padding-top:10px') . Again though, I need to do this in CSS and would appreciate a variation if the value was in a class also.