To select the first div in the class, I would recommend using this method
.yourClassName > div:first-child{
same if you want to select inside id just do it
but if you have an identifier, yours should have ONLY , otherwise you would encode Invalid HTML, just use a simple selector like this for id
also note that in @sourcecode answer that it currently does not have> in its example, without this, it will not select the first div inside the class, but will most likely select every first div inside this class to check this script for example of this
and here is a demonstration of my answer
source share