These are chat archives for FreeCodeCamp/HelpFrontEnd

30th
Oct 2017
Akash Malla
@mallaakash
Oct 30 2017 01:09
Is DJANGO easy for frontend ?? Or I should go for php ?? I want to call python functions I have written logic in python ??
Michael James Wong
@eyeturnred
Oct 30 2017 01:11
hey guys I'm having trouble doing the check for palinfrom algorithim challenge
i'm not understanding the expressions
korzo
@korzo
Oct 30 2017 01:19
@eyeturnred which expression?
Ismail Hozain
@ismailhozain
Oct 30 2017 02:04
hey guys i am having trouble getting started on my js calculator any help please?
my issue is that i set up the buttons and everything but have no clue what to do next
Dr-D-M
@Dr-D-M
Oct 30 2017 02:09
hello humans!
can anybody help me with the task of a random quote machine?
the page should suit for tablets and desktops, but, when I try to put the whole screen, everything goes out of its place
could you please tellme what i'm doing wrong?
I've done pretty much what I think is the responsive tags in css, but, don't quite know what i'm doing wrong
Akash Malla
@mallaakash
Oct 30 2017 02:14
Guys I have build a logic to extract resume details using python bcz python gui I's difficult any suggestions what I can do for front end ..
Michael James Wong
@eyeturnred
Oct 30 2017 02:16
I'm cheating looking at the solution for the palindrome code but I don't understand it at all it has (/[\W]/g I don't understand the [\W]
Dr-D-M
@Dr-D-M
Oct 30 2017 02:16
forget it, i solved it jajaja
Michael James Wong
@eyeturnred
Oct 30 2017 02:16
the fcc expression lesson didn't go over it at all but no sure what it meants
Dr-D-M
@Dr-D-M
Oct 30 2017 02:18
@mallaakash you should go to learn some python stuff.... or cheat the code as Michael said
Fabien SHAN
@X140hu4
Oct 30 2017 02:41
@eyeturnred You should look for tutorials/lessons on regular expressions
Ken Haduch
@khaduch
Oct 30 2017 02:53
@eyeturnred - in regular expressions, \w is an expression that matches any "word" character, which is the alphabetic characters, the numbers, and the underscore. The uppercase version of that expression \W matches any non-word characters, which is everything but a-z, 0-9, and the underscore character. I think that the expression that they have in that solution might include the underscore, like this: /[\W_]/g ? Which makes a group of expressions that will match any "non-word" characters as well as the underscore. Those are all of the characters that you want to remove from the input string that is being tested for palindromes.
Michael James Wong
@eyeturnred
Oct 30 2017 03:26
@khaduch thanks that helps i'm youtubing some regex tutorials now
CamperBot
@camperbot
Oct 30 2017 03:26
eyeturnred sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3433 | @khaduch |http://www.freecodecamp.com/khaduch
Michael James Wong
@eyeturnred
Oct 30 2017 03:26
how often you you actually use regular expressions in your everyday code?
Isaiah Trembley
@IsaiahCT
Oct 30 2017 03:27
which langauge
because, this all depends
Ken Haduch
@khaduch
Oct 30 2017 03:30
@eyeturnred - it depends on what you're doing, of course. Sometimes you need to use them to do things easily. The phone number validation code, for example, one of the exercises is accomplished handily with regular expressions. It might be the case that you end up using different packages (libraries) with validation routines in them that might have a regular expression used. It's hard to say how often you would be writing expressions, but it's a powerful and useful tool to have in your toolbox.
Ashwin
@ashwins93
Oct 30 2017 03:46
@eyeturnred a lot. Regex is very useful. Anytime you wanna process some text, regex is gonna be really helpful. It's useful especially in backend. It is used in validation and more
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:00

I am kinda confused, suppose I updated a value fetched from localstorage like this

const storeData = JSON.parse(JSON.parse(window.localStorage.getItem('mDr-default')).value)
  storeData['name'] = 'Pascal'

how do I save it back to localstorage without affecting its original format?

Long Nguyen
@longnt80
Oct 30 2017 04:11
@jalasem I think you need to get the whole object from localStorage and modify that object, then set that new object to localStorage
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:12
@longnt80 can you show me?
Long Nguyen
@longnt80
Oct 30 2017 04:12
so maybe something like this:
const newObject = JSON.parse( window.localStorage.getItem('mDr-default') );
newObject.value['name'] = 'Pascal';
window.localStorage.setItem('mDr-default', JSON.stringify(newObject) )
does this make sense?
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:19
that is what I did and it is not rhyming with the original object @longnt80
Long Nguyen
@longnt80
Oct 30 2017 04:19
can you post the original object?
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:20
okay

to get the original object I have to write this

JSON.parse(JSON.parse(window.localStorage.getItem('mDr-default')).value)

and then I will get this

{
  "userType": "user",
  "authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoX2lkIjoiNTlmNWRmMjBhMzA3MTU1NGM1Zjg0M2UxIiwibG9naW5fdHlwZSI6InBhdGllbnQiLCJpYXQiOjE1MDkzMzI3NjN9.RaTsSoWW8eBTErtlcagN4Bi5ZzVxfvsvcbmtTGNJiz0",
  "lastPage_tried": "/user/dashboard",
  "lastPage": "/user/dashboard",
  "subscribeInput_error": false,
  "area": {
    "resultsOn": false,
    "results":  []
  },
  "search": {
    "resultsOn": false,
    "results": []
  }
}

so I tried to update "lastPage_tried" and save it back to localstorage

Long Nguyen
@longnt80
Oct 30 2017 04:24
@jalasem ok maybe I'm wrong, but I think the object on localStorage is just a string
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:25
yes it was stringified when saved using a plugin
Long Nguyen
@longnt80
Oct 30 2017 04:25

so I tried to update "lastPage_tried" and save it back to localstorage

did it work?

Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:25
no
Long Nguyen
@longnt80
Oct 30 2017 04:25
I think you need to get the 'mDr-default' object
then modify that one
you can't get just one property of that object
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:26

that is what I am saying

const dataStore = JSON.parse(JSON.parse(window.localStorage.getItem('mDr-default')).value)
dataStore.lastPage_tried = '/secret_page'

how do I save it back?

Long Nguyen
@longnt80
Oct 30 2017 04:26

so I tried to update "lastPage_tried" and save it back to localstorage

how did you save it?

which method?
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:27
its automatically done via a plugin
Long Nguyen
@longnt80
Oct 30 2017 04:27
oh
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:28
now I dont want to use it again to minimize size and efficiency because I notice the plugin is about 200kb and that is all it does in the whole app
Long Nguyen
@longnt80
Oct 30 2017 04:30

const dataStore = JSON.parse(JSON.parse(window.localStorage.getItem('mDr-default')).value)

in this case, dataStore is not mDr-default, right?

Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:34
'mDr-default' is the localstorage key @longnt80
Long Nguyen
@longnt80
Oct 30 2017 04:48
@jalasem hmm, maybe I missed something, it should work
can you show how different it was compared to the original object?
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 04:52
okay
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 05:13
@longnt80 thanks!
now it worked
localStorage.setItem('mDr-default', JSON.stringify({value: JSON.stringify(storeData)}))
CamperBot
@camperbot
Oct 30 2017 05:13
jalasem sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 624 | @longnt80 |http://www.freecodecamp.com/longnt80
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 05:13
I was missing out something before
Long Nguyen
@longnt80
Oct 30 2017 05:13
@jalasem how did you fix it?
ok
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 05:14
localStorage.setItem('mDr-default', JSON.stringify({value: JSON.stringify(storeData)}))
Long Nguyen
@longnt80
Oct 30 2017 05:14
:thumbsup:
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 05:15
the plugin stringified and assigned it to a key called 'value' then stringified it again and pass it on to localstorage
@longnt80 now my app is 200kb lighter :)
Long Nguyen
@longnt80
Oct 30 2017 05:16
@jalasem nice
Abdul-Samii Ajala Olalekan
@jalasem
Oct 30 2017 05:16
thanks again for the attention @longnt80
Long Nguyen
@longnt80
Oct 30 2017 05:33
@jalasem np
Michael James Wong
@eyeturnred
Oct 30 2017 05:50
i'm confused about the codefunction palindrome(str) {
return str.replace(/[\W]/g, '').toLowerCase() ===
str.replace(/[\W
]/g, '').toLowerCase().split('').reverse().join('');
}
Long Nguyen
@longnt80
Oct 30 2017 06:04
@eyeturnred which part make you confused?
Chris Cullen
@123xylem
Oct 30 2017 06:20

Hey Guys!
http://kde.vjh.mybluehost.me/

Quick Design Question:
Can someone help me get the Vision Msonry Logo under the Hero Image to be aligned centrally?
I have had to add a margin to it as there appears to be a margin already pushing it off center.. But when the screen size changes the margin goes wrong...
Please Help me centralize the Vision Masonry Logo under the main hero banner!

Michael James Wong
@eyeturnred
Oct 30 2017 06:57
why is my code returning everything as true for the palindrome
Markus Kiili
@Masd925
Oct 30 2017 06:59
@eyeturnred First of all, str.toLowerCase().replace(re,""); returns a new string that you don't use.
To lowercase a string, you need to do str=str.toLowerCase(); etc.
Strings are immutable.
For the actual palindromicality check, you should use array reverse or a loop, not both.
If you use the reverse method, just return str===reverseStr;
mandeep9362
@mandeep9362
Oct 30 2017 07:08

hey needing help with this code css :-

.icon_box .icon_wrapper:hover.icon_box .icon_wrapper i {
color:#fff;
}

i want to hover over icon box and change the color of icon
Michael James Wong
@eyeturnred
Oct 30 2017 07:09
@Masd925 thank yea that way was what I did first but now i'm trying to code it using the loop way and its not working
CamperBot
@camperbot
Oct 30 2017 07:09
eyeturnred sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4549 | @masd925 |http://www.freecodecamp.com/masd925
Michael James Wong
@eyeturnred
Oct 30 2017 07:10
https://repl.it/CLjU/4649 change it a little bit but still not sure what wrong here now
Markus Kiili
@Masd925
Oct 30 2017 07:11
@eyeturnred You need to reverse newStr, not str.
It needs to be like this:
function palindrome(str) {
  // Good luck!

  var re = /[\W_]/g;

  var newStr= str.toLowerCase().replace(re,"");

  return newStr===newStr.split("").reverse().join("");

}
Michael James Wong
@eyeturnred
Oct 30 2017 07:13
@Masd925 oh wow nice catch that worked
thanks
Markus Kiili
@Masd925
Oct 30 2017 07:13
So that if and while are just redundant.
mandeep9362
@mandeep9362
Oct 30 2017 07:14

hey needing help with this code css :-

.icon_box .icon_wrapper:hover.icon_box .icon_wrapper i {
color:#fff;
} i need to fix it help thanks in advance

Znadams
@Znadams
Oct 30 2017 07:36

```var flavor = "strawberry";
var vessel = "bowl";
var toppings = "sprinkles";

// Add your code here

if((flavor == "chocolate" || "vanilla") && (vessel == "cone" || "bowl") && (toppings == "sprinkles" || "peanuts") )
{
console.log("I'd like two scoops of " + flavor+ " ice cream in a " + vessel + " with " + toppings);
}
```

var flavor = "strawberry";
var vessel = "bowl";
var toppings = "sprinkles";



// Add your code here

if((flavor == "chocolate" || "vanilla") && (vessel == "cone" || "bowl") && (toppings ==  "sprinkles" || "peanuts") )
    {
        console.log("I'd like two scoops of " + flavor+ " ice cream in a " + vessel + " with " + toppings);        
    }
Why does this if-block execute when the first condition should be returning false?
Znadams
@Znadams
Oct 30 2017 07:47
I solved the issue, thanks you guys
Tiago Correia
@tiagocorreiaalmeida
Oct 30 2017 08:41
good morning
alpox
@alpox
Oct 30 2017 09:10
@tiagocorreiaalmeida :wave:
Ayush Bahuguna
@relentless-coder
Oct 30 2017 09:20
can I listen on nodejs uncaughtException event globally or in individual modules only?
any suggestions guys
Naaman Saif
@Naaman-Saif
Oct 30 2017 11:00
Hi Can anybody help me with the WikiPedia API?
korzo
@korzo
Oct 30 2017 11:04
@Forlenza What's the problem?
Naaman Saif
@Naaman-Saif
Oct 30 2017 11:15
Its done bud It was just http and https problem
korzo
@korzo
Oct 30 2017 11:18
@Forlenza You can't call http from https page. In this case, you need proxy for this request
kutagullasukumar
@kutagullasukumar
Oct 30 2017 14:58
var myStr = "I am a\"double quoted\"string inside\"double quotes\".";
hi what is wrong in that?
Ken Haduch
@khaduch
Oct 30 2017 15:22
@kutagullasukumar looks like you might be missing spaces between words around the inside quotation marks? Put a space after the a and the first \, etc.
George Kemp
@gkemp94
Oct 30 2017 16:41
Anybody here a bootstrap expert? I can't get it to do what I want it to do, despite me thinking its a very simple request. I want a div to fill the window 100% in both the x and y directions have a 3px margin on either side and then a 4px border. Everything I create will sit in this div.
I cannot however get this to work. Any suggestions?
Kaz Baig
@kbaig
Oct 30 2017 16:49
@gkemp94 100% of the page or 100% of the viewport?
George Kemp
@gkemp94
Oct 30 2017 16:50
viewport, so basically if I go fullscreen all I see a 4px border 3px within the edge of the screen
Kaz Baig
@kbaig
Oct 30 2017 16:50
div {
    height: 100vh
    width: 100vw
}
is that not doing it
if you want to add a border, add box-sizing: border-box
not bootstrap but a simple enough solution
George Kemp
@gkemp94
Oct 30 2017 16:52
That works in the y axis not the x.
Kaz Baig
@kbaig
Oct 30 2017 16:52
can you link a pen
George Kemp
@gkemp94
Oct 30 2017 16:52
It takes up about 75% of the window.
Let me make a pen with what I have.
Kaz Baig
@kbaig
Oct 30 2017 16:54
so you want a margin of 3px on all side, then a 4px border
going around the viewport
right
@gkemp94
George Kemp
@gkemp94
Oct 30 2017 16:55
Yep!
korzo
@korzo
Oct 30 2017 16:56
@gkemp94 It's because it's on .container
Container has fixed max-width
Tam Nguyen
@bankplank
Oct 30 2017 16:56
Hey guys
How do I fix this float issue, increasing the height of the equal button will cause the floated zero and . buttons to be shifted down
George Kemp
@gkemp94
Oct 30 2017 16:57
@korzo Would it be better for me to just scrap bootstrap and do it by myself? Or should I just not use the container tag. I really wanted to use the grid system to organize what goes inside. That's the reason I'm trying to use it
korzo
@korzo
Oct 30 2017 16:57
@bankplank give button with "=" float: right
Tam Nguyen
@bankplank
Oct 30 2017 16:58
@korzo tytytyt!
korzo
@korzo
Oct 30 2017 16:58
@gkemp94 You can use bootstrap inside this wrapper with 100% width/height
George Kemp
@gkemp94
Oct 30 2017 17:02
okay, I think I figured out how to best go about it with that advice.
George Kemp
@gkemp94
Oct 30 2017 17:05
@kbaig Oh perfect, that's not what I was doing but that works perfectly. I've never used the calc function before
Kaz Baig
@kbaig
Oct 30 2017 17:06
@gkemp94 :)
This is why I prefer doing my own styling over bootstrap. Most things aren't too hard to implement and I don't want to spent so much time learning boostrap just to ensure their styles aren't conflicting with mine
alexg1990
@alexg1990
Oct 30 2017 17:08

Hi, I am just trying to change the backgroundcolor of my div in react but it behaves in an interesting way.

this is my code, but instead of changing the backgroundcolor for the whole div, it is only changing for my first <p>:

    return (
      <div style={{width: '80%', margin: 'auto', backgroundColor: 'red'}}>
        <p className='quote'>{this.state.quote[0]}</p>
        <p className='author'>{this.state.author[0]}</p>
      </div>
    );
Kaz Baig
@kbaig
Oct 30 2017 17:08
@alexg1990 how are you changing the bg? Can you provide a pen if possible
alexg1990
@alexg1990
Oct 30 2017 17:09
inline like this: backgroundColor: 'red'
I am just copying it into codepen, brb
Kaz Baig
@kbaig
Oct 30 2017 17:14
@alexg1990 I don't see any logic handling bg color change
alexg1990
@alexg1990
Oct 30 2017 17:16
  <div style={{width: '80%', margin: 'auto', backgroundColor: 'white'}}>
Kaz Baig
@kbaig
Oct 30 2017 17:17
that's not changing color
alexg1990
@alexg1990
Oct 30 2017 17:17
backgroundColor is set to 'white' for the whole <div>. But it is only viewed for <p className='quote'>{this.state.quote[0]}</p>
Kaz Baig
@kbaig
Oct 30 2017 17:17
that's just setting it
oh you just want to set it
alexg1990
@alexg1990
Oct 30 2017 17:17
:)
Raymond Duckworth
@raymondxduckworth
Oct 30 2017 17:18
Hi all, I have a question about the ajax method. If someone provides an "endpoint", would you typically use that as the "url" param? I'm specifically asking because the entire query string is longer, and contains variables. Would the "data" param then include the rest of the query string (along with variables)?
Stephen James
@sjames1958gm
Oct 30 2017 17:18
@alexg1990 It appears that your float: right has moved the second p outside of the div
Kaz Baig
@kbaig
Oct 30 2017 17:20
oh yeah didn't realize there was css here
I've been thinking you're trying to add bg color change logic on a click event or something
Stephen James
@sjames1958gm
Oct 30 2017 17:20
@raymondxduckworth the query parameters would be part of the url
Kaz Baig
@kbaig
Oct 30 2017 17:21
@alexg1990 you can just text-align: right your author to do what I think you want instead of float
alexg1990
@alexg1990
Oct 30 2017 17:22
@sjames1958gm thanks
CamperBot
@camperbot
Oct 30 2017 17:22
alexg1990 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8631 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
alexg1990
@alexg1990
Oct 30 2017 17:22
@kbaig thanks, I am still a bit confused by that logic but it works with text-align
CamperBot
@camperbot
Oct 30 2017 17:22
alexg1990 sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 392 | @kbaig |http://www.freecodecamp.com/kbaig
Kaz Baig
@kbaig
Oct 30 2017 17:23
@alexg1990 which logic
Raymond Duckworth
@raymondxduckworth
Oct 30 2017 17:23
@sjames1958gm So would something like this work?
$.ajax({
    url: "https://www.someurl.com/blahblah" + variable + "restofurl.api"
});
Stephen James
@sjames1958gm
Oct 30 2017 17:23
@alexg1990 :+1:
alexg1990
@alexg1990
Oct 30 2017 17:23
@kbaig that using float results in my paragraph not being associated with my div anymore
Stephen James
@sjames1958gm
Oct 30 2017 17:23
@raymondxduckworth Depends on what is in the variable.
the query parameters would come after the URL "path" following ?
short of it is that elems with float don't necessarily confirm to the surrounding dom structure. In most cases, you could probably use flexbox/grid instead
Raymond Duckworth
@raymondxduckworth
Oct 30 2017 17:26
@sjames1958gm In my case, it's just a string that needs to be included in the query. But I feel like I'm confusing myself with the "data" param, because I thought that whatever you're querying needs to go there...
Stephen James
@sjames1958gm
Oct 30 2017 17:27
@raymondxduckworth Generally if you are doing a GET action then all of the query information is in the URL.
For example
https://www.example.com/api/weather?lat=0&lon=90
@raymondxduckworth Ah, I see, $.ajax also provides for this in the data property.
@raymondxduckworth It appears that this would support the following with
https://www.example.com/api/weather
{
  lat: 0,
  lon: 90
}
@raymondxduckworth At that point is is probably personal preference.
Raymond Duckworth
@raymondxduckworth
Oct 30 2017 17:33
@sjames1958gm Ah, I see. I'll have to play with it a bit more. Thanks for your help!
CamperBot
@camperbot
Oct 30 2017 17:33
raymondxduckworth sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8632 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ismail Hozain
@ismailhozain
Oct 30 2017 18:04
hey guys i am having issues with my JS calculator -i have the buttons and stuff set up but do not know what to do next.
Rodney Guillen
@infrony
Oct 30 2017 18:21
hi @all
Stephen James
@sjames1958gm
Oct 30 2017 18:37
@ismailhozain You probably need a current number display, and as numbers are entered you collect those until an operator is clicked (store the op)
Then start a new number, and when = is pressed perform the operation. (You probably need an = key).
You will need to protect against numbers too large, divide by zero, etc.
Richard
@rylew0925
Oct 30 2017 18:50
Would someone please assist me with a lesson I'm working on?
Kaz Baig
@kbaig
Oct 30 2017 18:51
@rylew0925 What do you need help with
Richard
@rylew0925
Oct 30 2017 18:52
let restaurant = {
  _name: 'Italian Bistro',
  _seatingCapacity: 120,
  _hasDineInSpecial: true,
  _entrees: ['Penne alla Bolognese', 'Chicken Cacciatore', 'Linguine pesto'],

  set seatingCapacity(seatingCapacity) {
      if (typeOf newCapacity === 'number') {
        this._seatingCapacity = newCapacity;
    } else {
        console.log(`Change ${newCapacity} to a number.`)
    }
  },

  get seatingCapacity() {
      console.log(`There are ${this._seatingCapacity} seats at Italian Bistro.`);
      return this._seatingCapacity;
  }
}
restaurant.seatingCapacity = 150;
const seats = restaurant.seatingCapacity;
Where is says
set seatingCapacity(seatingCapacity) {
Shouldn't it be set seatingCapacity(newCapaity) { ?
newCapacity
Kaz Baig
@kbaig
Oct 30 2017 18:54
@rylew0925 Looks like it yeah
Richard
@rylew0925
Oct 30 2017 18:54
So was that a mistake in the lesson's part or is it actually correct?
Kaz Baig
@kbaig
Oct 30 2017 18:55
Probably a mistake
If this is all of the code, then yeah
Richard
@rylew0925
Oct 30 2017 19:09
@kbaig Thanks
CamperBot
@camperbot
Oct 30 2017 19:09
rylew0925 sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 393 | @kbaig |http://www.freecodecamp.com/kbaig
Gunasai Garapati
@gunasai
Oct 30 2017 19:31
Screen Shot 2017-10-30 at 3.09.54 PM.png
Hey guys, I'm having an issue with the header. Maybe I'm missing some small details. But, anyways, the header has a whitespace above it. But when I add a border, it disappears. Need help with this.
Screen Shot 2017-10-30 at 3.09.27 PM.png
Kaz Baig
@kbaig
Oct 30 2017 19:33
@gunasai did you remove the margin from body?
Gunasai Garapati
@gunasai
Oct 30 2017 19:34
I did not use a margin.
eader {
    height: 55px;
      width: 100%;
      background-color: #55d6aa;    
 }



nav {
    float: right;
}

nav ul {
    padding: 0px;
    margin-top: 5px;

}

nav li {
    display: inline-block;
    float: left;
    margin-left: 70px;
    padding-top: 15px;
    position: relative;
}

nav a {
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
}

nav a:hover {
    color: #000;
    text-decoration: none;
}
The CSS for header
<header>
        <div class="container">
            <ul>
                <li><img class="logo" src="assets/logo.png"></li>
            </ul>
            <nav>
                <li><a href="#">Work</a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Contact</a></li>
            </nav>
        </div>
    </header>
The HTML
Victor De Los Santos
@rdelosh
Oct 30 2017 19:36
i think its overflow
Gunasai Garapati
@gunasai
Oct 30 2017 19:37
Yea, I think it is. Let me try.
Ashwin
@ashwins93
Oct 30 2017 19:41
@gunasai try
body, html {
  margin: 0;
  padding: 0;
}
Gunasai Garapati
@gunasai
Oct 30 2017 19:41
Actually, overflow works
thanks @rdelosh
CamperBot
@camperbot
Oct 30 2017 19:42
gunasai sends brownie points to @rdelosh :sparkles: :thumbsup: :sparkles:
:cookie: 76 | @rdelosh |http://www.freecodecamp.com/rdelosh
Gunasai Garapati
@gunasai
Oct 30 2017 19:43
It works with overflow. But thanks @ashwins93
CamperBot
@camperbot
Oct 30 2017 19:43
gunasai sends brownie points to @ashwins93 :sparkles: :thumbsup: :sparkles:
:cookie: 401 | @ashwins93 |http://www.freecodecamp.com/ashwins93
Mercy Manrique
@mers89
Oct 30 2017 19:46
I had a question in the css styling for buttons. I called one of my buttons btn-primary. When I style btn-primary it affects the .btn-medium as far as sizing even though I didnt edit the sizing on the btn-medium
It will prob make more sense I paste my code. Working on tic-tac-toe game. Decided to make the game via buttons. I wanted to make the # buttons square. The first 2 buttons with an "x" and "o" I wanted to make smaller
korzo
@korzo
Oct 30 2017 19:51
@mers89 btn-primary is bootstrap class. It you change it, it will affect it on all places.
Instead of this add another class and use it to override btn-primary styles
@mers89 For example in your code you can move your modification to .btn-primary.tic
Mercy Manrique
@mers89
Oct 30 2017 19:54
@korzo got it, thanks! I thought the bootstrap class was .btn only
CamperBot
@camperbot
Oct 30 2017 19:54
mers89 sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 703 | @korzo |http://www.freecodecamp.com/korzo
korzo
@korzo
Oct 30 2017 19:57
@mers89 bootstrap buttons have modifiers for style and size. https://getbootstrap.com/docs/3.3/css/#buttons-options
Mercy Manrique
@mers89
Oct 30 2017 19:58
@korzo I think it might have been a codepen glitch. It started to work all of a sudden :)
eswhy27
@eswhy27
Oct 30 2017 21:10

hello working on the passing values to functions with arguments challenge and wondering why my function does not work function

functionWithArgs(param1, param2){
return param1 + param2;
}

When I call it with the arguments (2,4) it returns 5

Kaz Baig
@kbaig
Oct 30 2017 21:30
@eswhy27 it should work fine. link?
Raymond Duckworth
@raymondxduckworth
Oct 30 2017 21:52

Hi all!
I'm working on the Wikiviewer project, and I'm getting stuck on the API call. I included headers for the User Agent, per the Wiki docs, but I still am unable to access the API.
Here is my code for the ajax function:

  $.ajax({
    url: "https://en.wikipedia.org/w/api.php?",
    data: "action=query&format=json&prop=revisions&list=search&rvprop=content&srsearch=" + currentSearch + "&srprop=snippet",
    dataType: "json",
    type: "GET",
    headers: {"Api-User-Agent": "MyWikiViewer/1.0 (raymondxduckworth)"},
    success: function(data) {
      console.log(data);
    }
  });

My codepen link is: https://codepen.io/raymondxduckworth/pen/yzvEjq?editors=0010

What else am I missing in order to bypass the CORS error?
Thank you!

Ian
@Naiguy1
Oct 30 2017 22:56
I worked great on my computer.
I need help with my code and i don't know why it is not working.

//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];

function lookUpProfile(firstName, prop){
// Only change code below this line
if(contacts.hasOwnProperty(firstName));
else if (contacts.hasOwnProperty(prop)); else{
return (value);
}else;{
return "No such contact";
return "No such property";
}

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");

korzo
@korzo
Oct 30 2017 23:28
@Naiguy1 2 errors
@Naiguy1
}else;{ there shouldn't be ;

@Naiguy1

return "No such contact";
return "No such property";

return "No such property"; will be never reached

@Naiguy1 Anyway, it's all wrong.
At first you have to iterate over contacts array and find all contacts with give property
Tiago Correia
@tiagocorreiaalmeida
Oct 30 2017 23:35
@korzo cna you check the js chat and maybe save me ?:D
korzo
@korzo
Oct 30 2017 23:35
@tiagocorreiaalmeida sure, can you link me to post?
Tiago Correia
@tiagocorreiaalmeida
Oct 30 2017 23:36
nm localstorage only accepts strings I was trying to make an if statement based on a string thinking it was a boolean :D