# Code working in vs code but not in codepen

**URL:** <https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784>\
**Category:** General\
**Created:** [May 1, 2019, 5:30pm UTC](https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784 "2019-05-01T17:30:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FuriousJK](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/furiousjk/32/105614_2.png) [@FuriousJK](https://forum.freecodecamp.org/u/FuriousJK)\
**Post date:** [May 1, 2019, 5:30pm UTC](https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784/1 "2019-05-01T17:30:16Z")

</div>

[https://codepen.io/FuriousJK/pen/YMoNgZ](https://codepen.io/FuriousJK/pen/YMoNgZ)

Can someone help me with migrating code from VS Code to Codepen? I am trying it since past hour but it ain’t working.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [May 1, 2019, 5:46pm UTC](https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784/2 "2019-05-01T17:46:16Z")

</div>

Looks like you’re having cross origin request issues. If you search around the forum, you’ll see how other people have solved that.

---

<div class="post-metadata">

**Author:** ![SalimDev](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/salimdev/32/114342_2.png) [@SalimDev](https://forum.freecodecamp.org/u/SalimDev)\
**Post date:** [May 1, 2019, 5:52pm UTC](https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784/3 "2019-05-01T17:52:27Z")

</div>

I think that I found the issue it’s `width: -37.5rem;` and `opacity: 0;`in your `.quotes` class.  
-remove the (-) sign  
-make opacity: 1  
and your page will appear

---

<div class="post-metadata">

**Author:** ![FuriousJK](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/furiousjk/32/105614_2.png) [@FuriousJK](https://forum.freecodecamp.org/u/FuriousJK)\
**Post date:** [May 1, 2019, 5:55pm UTC](https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784/4 "2019-05-01T17:55:16Z")

</div>

All the cross origin requests seems to be for the API call. I have used JSON file locally on my pc. I copied the JSON code and made a new pen for that and added its url ([https://codepen.io/FuriousJK/pen/rbEjqE](https://codepen.io/FuriousJK/pen/rbEjqE)) inside the fetch request. Is that right?

---

<div class="post-metadata">

**Author:** ![FuriousJK](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/furiousjk/32/105614_2.png) [@FuriousJK](https://forum.freecodecamp.org/u/FuriousJK)\
**Post date:** [May 1, 2019, 6:02pm UTC](https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784/5 "2019-05-01T18:02:01Z")

</div>

Doing that will only make all the buttons appear. Besides, I did that to later change it via javascript code. If you want to see the end result of the vs code then you can try copying the code in it and for json file use [this](https://codepen.io/FuriousJK/pen/rbEjqE) code.

Here’s how the final result look like after running it on the live server of VS Code editor,

 ![Screenshot_2019-05-01%20Random%20Quote%20Generator](https://global.discourse-cdn.com/freecodecamp/original/3X/b/c/bc111be5aa9d7684b18806ebedf390572055983a.jpeg)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 6:43pm UTC](https://forum.freecodecamp.org/t/code-working-in-vs-code-but-not-in-codepen/274784/6 "2021-01-16T18:43:09Z")

</div>

Closed on January 16, 2021, 6:43pm UTC


