These are chat archives for FreeCodeCamp/HelpFrontEnd

3rd
Oct 2018
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 12:20

why adding this to my code align-items: center; doesnt align my list elements in the middle of the nav?(vertically)

https://gitter.im/FreeCodeCamp/CodeReview

same goes for vertical-align: middle;
Nicolas Ramirez
@kamatheuska
Oct 03 2018 12:32
@thodorisanta yep, it lookjs kind of plain
breath some life into it :D
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 12:33
maybe its dead :( @kamatheuska
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 12:40
okay i did something but i have no idea how i did it.. is that a good sign? :D
Brad
@bradtaniguchi
Oct 03 2018 17:09
@thodorisanta considering FCC is for learning, id look into it to get a grasp of what you did.
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 17:12
@bradtaniguchi no i found my way into it
now im just confused as to why my when i put margin: 0; in the nav in my css, my list aligned vertically. which is what i wanted btw but i thought margin: 0; centers an object horizontally. any idea why? @bradtaniguchi
Brad
@bradtaniguchi
Oct 03 2018 17:16
@thodorisanta margin: 0 takes away margin space around your element, it should have nothing todo with aligning things, unless the things your "aligning" have inconsistent margins and or padding
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 17:23
@bradtaniguchi so how else can i do the same thing?
cause nothing i tried seemed to work..
https://codepen.io/oshikurou/pen/vVLrVo
Brad
@bradtaniguchi
Oct 03 2018 17:24
What exactly is not working?
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 17:45
i want the middle of the logo(trombone image) to be in a straight line with the middle of the 3 links in the navbar. as it is now. but i did it by placing margin: 0; in the css on the navbar. my question is. How can i do it without the margin: 0; ?
Brad
@bradtaniguchi
Oct 03 2018 17:57
@thodorisanta have you looked into using vertical alignment? Also I see you have *{margin: 0} are you sure you want todo that? My understanding is now all elements by default have no margin
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 18:03
@bradtaniguchi i did try vertical alignment, im pretty sure i used it correctly but it didnt seem to work.
someone in the same group(if im not mistaken) told me that most of the time webpages have a default margin etc so i should put this so everything will start with 0 margin
Brad
@bradtaniguchi
Oct 03 2018 18:07
You could specify the html, and body tags to have 0 margin
Spyrantis Theodoros
@thodorisanta
Oct 03 2018 18:35
sorry it wasnt margin: 0 above... it was margin: auto;
@bradtaniguchi sorry my bad
Manan Shah
@mananshah51
Oct 03 2018 21:24
FBPosts.filter(function(post) {
  return post.thumbnail !== null && post.shares > 100 && post.likes > 500;
})
Can anyone explain me this piece of code, what are these lines doing ?
The challenge is ES6: Write Higher Order Arrow Functions
Brad
@bradtaniguchi
Oct 03 2018 21:31
@mananshah51 the filtermethod on arrays is a "higher-order-function" in that its a function that takes a function as a parameter
Christopher McCormack
@cmccormack
Oct 03 2018 21:31
@mananshah51 FBPosts is an array with a filter method. filter iterates over the array and removes any item if the callback function returns false, then returns a new array with only truthy values. The expression following the return basically checks three conditionals in order and if any one of them fails the callback will return false
Brad
@bradtaniguchi
Oct 03 2018 21:31
^
Christopher McCormack
@cmccormack
Oct 03 2018 21:32
dangit
why does that keep happening haha
Brad
@bradtaniguchi
Oct 03 2018 21:32
haha
you gave a better explination, I only started haha
Manan Shah
@mananshah51
Oct 03 2018 21:38
@cmccormack Okay I somewhat get it.
@bradtaniguchi Okay I also get what you meant.