When deciding where to position a child element, should it be done within its own CSS scope or from the parent?
In the scenario provided below, would it be more effective to use margin-left: auto;
on the parent element or the child element (both options are functional)?
Vue.component('Child', {
template: `
<div class="childClassFromItself">
Hi from the child
</div>
`
})
new Vue({
el: '#demo',
})
#demo {
display: flex;
}
.childClassFromParent {
/*margin-left: auto;*/
}
.childClassFromItself {
margin-left: auto;
}
<div id="demo">
{{ message }}
<Child class="childClassFromParent"/>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
Is one approach superior to the other, or does it depend too much on the specific component being used?