Can't get flexbox to do anything

My biggest issue when working with css is trying to get the selectors to actually target what they're suppose to. In this case, I can't get the flex display to do flex-end in the upper right hand corner and I need to make the svg white. Any thoughts on what im doing wrong? https://codepen.io/MD-2016/pen/KKBwaXy
MD
CodePen
New Tab Mock
...
95 Replies
b1mind
b1mindā€¢3y ago
parent > child relationship You only have one flex child .glinks
MD
MDOPā€¢3y ago
yeah it's got 3 children before I just had the .glinks how should I be targeting things?
b1mind
b1mindā€¢3y ago
I'm not sure I understand
MD
MDOPā€¢3y ago
in order to get flex to work properly and align it in the upper right hand corner šŸ™‚
b1mind
b1mindā€¢3y ago
you need justify-content on the parent then .wrapper
MD
MDOPā€¢3y ago
.glinks > *{} doesn't seem to do much
b1mind
b1mindā€¢3y ago
Right again you need to think about the parent child relationship So .wrapper is flex parent .glink is flex child glink does not inherit flex
MD
MDOPā€¢3y ago
oh? I thought it was flex on a div then rest are flex items?
b1mind
b1mindā€¢3y ago
only the direct children again this is really important to picture
b1mind
b1mindā€¢3y ago
b1mind
b1mindā€¢3y ago
So you can't use flex properties on a child I think this is what you are after CSS is all boxes in boxes and the relationship betwix those parent > child boxes
MD
MDOPā€¢3y ago
yeah
b1mind
b1mindā€¢3y ago
side note grid with a single child would work similar
MD
MDOPā€¢3y ago
b1mind
b1mindā€¢3y ago
MD
MDOPā€¢3y ago
my goal is this page and currently that upper right hand corner šŸ™‚ can you breakdown flex so that it makes more sense :3 all the examples I see are some parent div getting display flex then the children being moved around
b1mind
b1mindā€¢3y ago
But flex does not have justify-self so you cant do this like you can with grid
b1mind
b1mindā€¢3y ago
Mate I took Kevins course just to make it make sense lol
MD
MDOPā€¢3y ago
yeah it's weird to me
b1mind
b1mindā€¢3y ago
Flex can be silly honestly but most people don't use half of it they just justify/align and imo Grid does that 100% better
MD
MDOPā€¢3y ago
Travesy media said he does his overall layout in grid and the inner content with flex but that's his preference
b1mind
b1mindā€¢3y ago
Yea just depends, I don't live in absolutes like that There is so many ways to skin a website Its more about looking at needs and creating a system for that specific design imo
MD
MDOPā€¢3y ago
yeah im just trying to find something that sticks
b1mind
b1mindā€¢3y ago
Do you understand this issue at hand though? You were trying to declare flex properties on a flex child
MD
MDOPā€¢3y ago
yeah the parent to child issue
b1mind
b1mindā€¢3y ago
yup
MD
MDOPā€¢3y ago
flex only works on a parent?
b1mind
b1mindā€¢3y ago
I mean you will probably end up making .glinks flex too Yes so does grid Its not an inherit property that would get crazy imo
MD
MDOPā€¢3y ago
aaaahhhhh making .glinks flex made it vanish from the page lol
b1mind
b1mindā€¢3y ago
So when you make a Flex parent it then has flex child/ren don't overflow hidden body >.>;;
MD
MDOPā€¢3y ago
yeah I was following some of the code from dev tools they have that flex is still new to me šŸ™‚
b1mind
b1mindā€¢3y ago
So flex children will follow the direction parent sets default its row Also it will make its children shrink to their max-content and put them in a row
MD
MDOPā€¢3y ago
do I need to resize the header or .wrapper
b1mind
b1mindā€¢3y ago
for what?
MD
MDOPā€¢3y ago
to get them to align in a row like the pic so they have enough space or make the wrapper flex too?
b1mind
b1mindā€¢3y ago
too many divs make header.wrapper
b1mind
b1mindā€¢3y ago
MD
MDOPā€¢3y ago
ah ok šŸ™‚
b1mind
b1mindā€¢3y ago
and its good to go you will have to size your svg or it will poof though
MD
MDOPā€¢3y ago
:root {

}

body {
background-color: #35363a;
margin: 0;
}

.wrapper {
display: flex;
justify-content: flex-end;
}

.glinks {
display: flex;
justify-content: flex-end;
}


svg {
color: white;
background-color: white;
}
:root {

}

body {
background-color: #35363a;
margin: 0;
}

.wrapper {
display: flex;
justify-content: flex-end;
}

.glinks {
display: flex;
justify-content: flex-end;
}


svg {
color: white;
background-color: white;
}
b1mind
b1mindā€¢3y ago
again why I like grid >.>;; we been through this don't define height/width if you don't need too
MD
MDOPā€¢3y ago
grid was a little easier but I feel like I need to learn flex too
b1mind
b1mindā€¢3y ago
you don't need to tell it defaults either row and no wrap are default
MD
MDOPā€¢3y ago
sorry im slow at this šŸ˜¦
b1mind
b1mindā€¢3y ago
na its ok trying to teach ya šŸ˜„ so you will have to define a height/width for the svg or it will squish to 0 as a flex child
MD
MDOPā€¢3y ago
probably should be small based on the example and I need to add gap
b1mind
b1mindā€¢3y ago
Also because a flex child of flex parent it wont fill 100% you don't need to redine the flex end but you let the small be based on font-size and padding Always try to let the child content determine height
MD
MDOPā€¢3y ago
0.5 rem is barely noticable trying to follow their source code they got way to many divs and long name names
b1mind
b1mindā€¢3y ago
don't follow their code Try to create it how you would cleaner than theirs šŸ˜‰ theirs is a absolute mess
MD
MDOPā€¢3y ago
b1mind
b1mindā€¢3y ago
overcomplicated for google reasons I'm sure
MD
MDOPā€¢3y ago
this what I got so far
b1mind
b1mindā€¢3y ago
so with SVG you have to color things using svg properties too if you want the dots white you need to use fill: white; probably on the svg > path {} too not the full svg oh no it does inherit fine šŸ˜„ I just like to be specific lol
MD
MDOPā€¢3y ago
woot that worked šŸ™‚ now I need to add gap the gap does push the svg out of range
MD
MDOPā€¢3y ago
it's white!
b1mind
b1mindā€¢3y ago
So if you wanna cheat here is my clean version https://codepen.io/b1mind/pen/dyjPNLo?editors=0110 I'd probably do the whole thing in grid > flex round the icons undersearch for the flex-wrap šŸ˜„ good practice to do all in flex though admit
MD
MDOPā€¢3y ago
my weaknesses keep showing with each design it seems it's always I can't remember all the css selectors then know how to break things down to see what youre see to know to use this and this to make it work
b1mind
b1mindā€¢3y ago
Boxes in boxes I can't express that enough
MD
MDOPā€¢3y ago
like your padding didnt even thinkg of that
b1mind
b1mindā€¢3y ago
Like when I visualize a design its all what box fits in what box with what parent what properties does each need
MD
MDOPā€¢3y ago
I just hope im getting better šŸ˜¦ I need to be job hunting by next year
b1mind
b1mindā€¢3y ago
Always getting better just keep building
MD
MDOPā€¢3y ago
šŸ™‚
b1mind
b1mindā€¢3y ago
I'm trying to show you the path of least resistance and its taken me years and still always learning. So it never stops and you can only compare yourself to your past self. Like honestly that padding probably needs to be distributed so the <a> links are fatter
MD
MDOPā€¢3y ago
yeah just jobs expect me to build a netflix clone or im not worthy :/
b1mind
b1mindā€¢3y ago
pfff netflix clones lol Idk I'm not big on clones, I rather see you take someones design and make it Stand out from the others don't do what they are doing
MD
MDOPā€¢3y ago
so what im doing is better practice?
b1mind
b1mindā€¢3y ago
I mean yea, like your cobra kai thing? Find stuff or products/topics that interests you find a design around that and code it. You will find it will be easy to talk about cause you enjoyed it more passion you ahve the easier it is to learn and complete too Don't stop this newtab clone cause its good flex practice like you are trying but don't look at their source
b1mind
b1mindā€¢3y ago
Ahhh I wish I had a link to Meowflix... https://meowflix.annietaylorchen.com/
Meowflix
Meowflix - the world's best cat-themed streaming service! A project by Annie Taylor Chen.
MD
MDOPā€¢3y ago
these are some projects id like to build 1. NHL team fan pages and stats based analyzer 2. College football data analyzer 3. something with weather 4. a video game ranking site 5. A Jquery to modern JS converter these are just some ideas off hand that's what Id like to work to
b1mind
b1mindā€¢3y ago
So that is a proper "netflix" clone that I linked you Looks like meh.. they don't design but... all the elements are there She gave a talk on this website too and imo one the reasons she got her job and her current job
MD
MDOPā€¢3y ago
this is probably one of the best looking sites ive helped with the nav bar at the top has a soccer ball on each player name on hover and the side nav on left the text gets smaller and moves right with an animation and the big screen transitions and the bottom clothing is a carousel it's beautiful šŸ™‚
b1mind
b1mindā€¢3y ago
Point being keep at it You have a degree and backend knowhow make sure you flaunt it some too I mean just by your project list... analyzers haha love it
MD
MDOPā€¢3y ago
one of my friends told if I dont break in soon my degree will almost mean nothing
b1mind
b1mindā€¢3y ago
fuk your friend You don't need more negativity mate šŸ˜„ Tell him to shut up lol
MD
MDOPā€¢3y ago
guy on youtube I watch suggested in his live stream for backend I build some tools that help with a particular task in backend like some service or tool like a bug finder
b1mind
b1mindā€¢3y ago
Backend you need to be looking for open source stuff Tooling all that jaz lots of open source projects that would pad you Or like you are doing try to learn Frontend to break into backend.. or again build things Showcase those skills in away that people can see .
MD
MDOPā€¢3y ago
I was trying to help with open source on building the transpiler for the language jakt that converts jakt code to c++ in the serenity community Just got rough trying to keep up because the others could code for hours and my life distractions kept me away more There are times I think of projects then think of add ons to those projects like with weather I wanted to get a small weather station setup in my yard and collect the data and send it off to the weather underground community but also build tools as I see them to do other things with that data and maybe add additional stuff to my report
b1mind
b1mindā€¢3y ago
Your so close to the metal šŸ˜…
MD
MDOPā€¢3y ago
Hows this for a project... I build something that pulls YouTube video captions and converts the captions into like a daily rss feed?
b1mind
b1mindā€¢3y ago
Cursed but good
MD
MDOPā€¢3y ago
Depending on the content a course Like a podcast it could work
b1mind
b1mindā€¢3y ago
Yea
MD
MDOPā€¢3y ago
That's my biggest issue
b1mind
b1mindā€¢3y ago
We ranted your thread
MD
MDOPā€¢3y ago
Huh?
b1mind
b1mindā€¢3y ago
went way offtopic of flexbox lol
MD
MDOPā€¢3y ago
Any suggestions on what I should study anyway from the desktop during the day tomorrow? Should I watch flexbox videos and take any notes?
b1mind
b1mindā€¢3y ago
I strongly believe you need to code as you watch but I'm not a note taker so if that works for you sure What I do is I watch and then I play/break/repeat Typically with a goal in mind like you are doing
MD
MDOPā€¢3y ago
I won't have a computer til after 4pm šŸ˜¦
b1mind
b1mindā€¢3y ago
Listen to podcasts about dev šŸ˜„
MD
MDOPā€¢3y ago
Which ones? Syntax?
b1mind
b1mindā€¢3y ago
always a good one Wes and Scott are great CompressedFM Whiskey Web and What not CSS podcast JS Party HTML all the Things ShopTalk/Codepen CodingCatDev mmmm those are my main gotos
MD
MDOPā€¢3y ago
ill check those tomorrow since ill have time to with my other tasks šŸ™‚
Want results from more Discord servers?
Add your server