I'm sorry for the dummy question, but coming from the WPF world, I'm having an hard time to align stuff in HTML/CSS.
I'm building a small app with Vue to train a bit myself on this, but it makes litteraly more than one hour than I'm struggling.
I'm building a header, which should have a left and right part.
Currently I've the following:
<template>
<div class="layout-topbar">
<div class="layout-topbar-left">
<a href="/" class="logo">App name</a>
</div>
<div class="layout-topbar-right"></div>
</div>
</template>
<style lang="scss" scoped>
a.logo {
text-decoration: none;
color: inherit;
}
.layout-topbar {
height: 4rem;
}
.layout-topbar-left {
margin: auto 0;
height: auto;
}
</style>
And I cannot figure out why the second div(the one with layout-topbar-left
class is sticking to the top even with the margin: auto 0;
?
(the current structure may not make much sense, but I will have additional elements inside the a
and inside the layout-topbar-left
)