VueJS Navbar

I know space-between would work, but I only want the links spaced sliiiighltly apart, like 20px or so..?
<script setup>
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
<header>
<h1>Gym Tracker</h1>
<div class="wrapper">
<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/nutrition">Nutrition</RouterLink>
<RouterLink to="/workouts">Workouts</RouterLink>
</nav>
</div>
</header>

<RouterView />
</template>

<style scoped>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2em;
}

h1 {
text-align: center;
font-size: 5rem;
}
</style>
<script setup>
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
<header>
<h1>Gym Tracker</h1>
<div class="wrapper">
<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/nutrition">Nutrition</RouterLink>
<RouterLink to="/workouts">Workouts</RouterLink>
</nav>
</div>
</header>

<RouterView />
</template>

<style scoped>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2em;
}

h1 {
text-align: center;
font-size: 5rem;
}
</style>
No description
28 Replies
Jochem
Jochem4d ago
gap: 20px;
ἔρως
ἔρως4d ago
^ or, you can use gap-column: 20px or something like that
Jochem
Jochem4d ago
though that's one of those where I'd probably use rem, cause it's visually linked directly to text-only components
ἔρως
ἔρως4d ago
that's about 1.2rem?
Jochem
Jochem4d ago
so gap: 1.25rem; 16px is 1, so 4 is .25
ἔρως
ἔρως4d ago
close!
Jochem
Jochem4d ago
very close 😄
CDL
CDL4d ago
I did gap but it didn't affect them, unless I'm targetting the wrong element
Jochem
Jochem4d ago
gap goes on the flex parent
ἔρως
ἔρως4d ago
you have to target the parent
CDL
CDL4d ago
yeah so I had gap: 20px on the wrapper
Jochem
Jochem4d ago
oh, hm, wait, the parent is nav isn't it then I can't tell you without seeing the rendered HTML
ἔρως
ἔρως4d ago
yes, the parent is the nav he has it all wrong
Jochem
Jochem4d ago
though I guess display: flex; gap:1.25rem; on nav should work
ἔρως
ἔρως4d ago
the .wrap shouldn't have the styles it should be the nav the nav is the one that has the children that's the one that needs the flex and that's where the gap goes as well
CDL
CDL4d ago
Do I even need to flex the nav btw? should I not just text-align: center;?
ἔρως
ἔρως4d ago
you only flex the nav remove .wrapper, put nav it should work
CDL
CDL4d ago
that done did diddly did it
No description
CDL
CDL4d ago
thank you gentlemen
ἔρως
ἔρως4d ago
you can remove the .wrapper element
CDL
CDL4d ago
yeah it's gone
ἔρως
ἔρως4d ago
the div is gone?
CDL
CDL4d ago
I removed the div
ἔρως
ἔρως4d ago
good 🤣
Jochem
Jochem4d ago
glad it's fixed, CDL!
CDL
CDL4d ago
it was there for the demo, I just didnt remove it until just now, didnt make any sense to have it in there but yeah, all good, thanks!
ἔρως
ἔρως4d ago
you're welcome
Want results from more Discord servers?
Add your server
More Posts
Tailwind CSS - Parent style when child is hoveredSo, I need to have a parent styled (background to blue) only when a child element is hovered. I've What are the dangers of allowing a user to specify a stylesheet?I've got a [NFT site](https://chiev.es) & I'm considering allowing users to specify custom page stylLooking for New Animation Ideas!I recently created an animation, which you can check out here : https://github.com/Ibrahim-AbuFarhrevealed content not starting at desired pointHey, i have 6 paragraphs, 3 of which are hidden that become revealed when pressing a button. When scWhen switching from one div to another the elements are jumpy why?is this the behaviour of div elements by default, when converted to button doesn't seem to have simiHow to make this number "1234567890" into "1,234,567,890"?So a whole number to separate by commas, so I can format it to look like that? Important thing is foi have a container that contains 6 items and i want 3 items of the exact same size in each rowi have a container that contains 6 items and i want 3 items of the exact same size in each rows ( i Slick slider inside a flex boxI have a slick-slider inside a two-column flexbox, but the slider is not respecting the parent contaAny ideas on how to create a double border chamfer with transparent background?I remember that Kevin has a good video on creating borders with cut corners here: https://www.youtubSuggestions on how to correctly handle 2 scrollable items on mobileI have a main webpage that scrolls like any other website would but on one of my pages I have a full