Can only override parent theme styling with ‘!important’ in child style.css

From the looks you’ve enqueued everything correct: Set the parent style as dependency, this way WordPress should first load the parent style and then the child style.

However, it can still happen that your rules are not applied, this is usually happening due to a rule being more specific. See this MDN article for more information.

As a solution, you can make your rules be more specific:

// parent
.main-content .mydiv

// child
body .main-content .mydiv
// or
.main-content .someclass .mydiv