These are chat archives for FreeCodeCamp/HelpFrontEnd

3rd
Dec 2018
Mohammed Boudad
@matrixersp
Dec 03 2018 01:57
@bradley1492 I'm not sure if it's the best way, but it works
https://codepen.io/matrixersp/pen/MzxepV?editors=1100
Lia-Sue-Kim
@Lia-Sue-Kim
Dec 03 2018 03:43
I don't know if someone here familiar with PHP but I wonder is pure php without a framework + mysql is enough ? or do you have to learn a framwork in order to build somehing with them
I'm still learning pure php that's why asked
@bradley1492 Do you want to center it with pure CSS or flexbox?
@bradley1492 or was that a bootstrap question?
Lia-Sue-Kim
@Lia-Sue-Kim
Dec 03 2018 03:52
@bradley1492 with pure css you can center horizontally if your element is block element by using margins. let's assume you have a navbar with height of 50px if you were to center something horizontally you could use margin: 0 auto;
your nav links you could center vertically by setting line-height: 50px;
if your nav's height is 50px;
like this
nav ul li a {
line-height: 50px;
}
Lia-Sue-Kim
@Lia-Sue-Kim
Dec 03 2018 03:57
with flexbox
  1. horizontally = justify-content: center;
  2. vertically = align-items: center;
Stevegolden12
@Stevegolden12
Dec 03 2018 05:30
@bradley1492 @Lia-Sue-Kim In bootstrap 4 the classes would be: justify-content-center and align-items-center.
Hope that helps.
Mandeep Sharma
@mandeephub
Dec 03 2018 07:12
hello

@Stevegolden12 https://codepen.io/mandeep4243/pen/pQYRzw

i m willing to bring that add note button in line with input box can u pls see to that
Thanks in advance

Claudio Restifo
@Marmiz
Dec 03 2018 08:25

@mandeephub if you head over navbar docs you see that they reccomend working with spacing and flex utilities to create a layout. That's because navbar has a more "strict" markup due to its intended "limited" usage.

In the example you see they use a form-inline element as a direct child of nav (not a container-fluid).

My suggestion is, if you want to keep the container-fluid / row system inside the navbar is to use auto layout columns

Mandeep Sharma
@mandeephub
Dec 03 2018 08:34
@Marmiz thanks for that i have updated that now y its going down on xs
Claudio Restifo
@Marmiz
Dec 03 2018 08:39
@mandeephub I suggest you keeping a documentation page open, and read it often., there's no xs breakpoint in BS 4
grid options
Mandeep Sharma
@mandeephub
Dec 03 2018 08:40
ok ill see to it thanks for help
Claudio Restifo
@Marmiz
Dec 03 2018 08:41
the same can be applied to col-sm-11 col-md-11 The md is redundant. :)
:+1:
Christopher
@bradley1492
Dec 03 2018 11:35
@Stevegolden12 @Lia-Sue-Kim @matrixersp Thanks a lot guys for your help.
This is what I was looking for, now it works :) :
https://codepen.io/bradley1492/pen/VVRdvQ?editors=1100
Christopher
@bradley1492
Dec 03 2018 11:42

Altough I have now another sort of implied question.
In this pen, is the reason for my logo not centering horizontally in responsive view, altough I have declared the flex, justify-content and align items properties in the css specificity?

https://codepen.io/bradley1492/pen/NEJzbQ?editors=1100

BrianWilliams28
@BrianWilliams28
Dec 03 2018 14:33
can someone tell me why NaN is evaluating as true in this function? it's supposed to return false
function isTrue (value){
 switch (value) {
   case "":
   case null:
   case NaN:
   case 0:
   case undefined:
   case false:
     return false;


   default:
     return true;
 } 
 }
isTrue([false, null, 0, NaN, undefined, ""]);
Christopher McCormack
@cmccormack
Dec 03 2018 16:26
I don't believe you can actually test NaN against itself
> NaN === NaN
false
> NaN == NaN
false

better to use something like

> isNaN(NaN)
true

or

> Boolean(NaN)
false
BrianWilliams28
@BrianWilliams28
Dec 03 2018 16:31
@cmccormack thanks, i came across isNaN() shortly after i posted this, still having trouble solving this problem but i'm closer now at least
@cmccormack Boolean(NaN) worked for this problem actually, thanks :)
Christopher McCormack
@cmccormack
Dec 03 2018 16:34
@BrianWilliams28 :thumbsup: np
BrianWilliams28
@BrianWilliams28
Dec 03 2018 19:40
can anyone recommend a good place to learn about javascript animations?
vanilla JS, not jquery
Brad
@bradtaniguchi
Dec 03 2018 19:52
@BrianWilliams28 Maybe look at MDN? Good place to start at least.
muhidav
@muhidav
Dec 03 2018 22:01
hello
i would love to know how we can use the reduce the size of an html element with using px only . and not using css
Jim Montgomery
@jimmielemontgomery
Dec 03 2018 23:17
What's the expected behavior when making multiple fetch requests for the same resource? Does fetch return a representation of the same request or make multiple independent requests, returning a promise for each? eg Promise.all[fetch('/'),fetch('/'),fetch('/')]).then(console.log) appears to make multiple requests when I use the devtools and have disable-caching OFF, which has me a little confused. What is the appropriate way to address this--ie when the non-POST responses are expected to look the same (and the request is the same)?
Brad
@bradtaniguchi
Dec 03 2018 23:27
@jimmielemontgomery AFAIK fetch will make the same request over and over, however many times its called. The browser potentially caching the request is a totally different store/level of abstraction. Now I ask what do you want to happen exactly?