Copy-Paste code from Sublime to PHP Storm went wrong - phpstorm

I'm new to html/css/js/php and i'm trying to create a site.I started working my html/css on a simple editor (Sublime-i know not the best idea),but in the meanwhile i started using PHP Storm. In order to get the pages i have made i copied the html content from Sublime and i pasted them in a new PHP file in PHP Storm (i did the same with the css). It turned out that transition went horrible and when i preview it is completely distrorted. Any ideas on what could have been so terribly wrong?

I had this issue before when I was trying to decide what to use sublime, phpstorm, and komodo edit. You need to copy the code across into a new .html or .php file. I can't recall which one does it but the file extension has something different that stops it.

Related

finding index.html on sidebar in visual studio code

Hi so I was trying to learn json for the first time and in the tutorial theres a section where you need to open index.html but that is not on my sidebar and I have absolutely no clue how to find/open it.
In the tutorial theres a drop down marked as "current project" which is not present on my screen and the index.html is in that. Is there an easy way to find where this is?
for anyone curious the tutorial im following is https://www.youtube.com/watch?v=iiADhChRriM and I saw at 6:43 it was there when he opened the program
this is my sidebar for reference
idk if im just dumb or my progam is being stupid but i need to find the answer so i can continue this project as soon as possible
Ok, so here is how the visual studio code side bar works, the first line you see (open editors) is a list of all open files, you don't have to pay mind to it,
but you can use it to find files you were editing earlier if you want.
The second line (physicsdemoassessment) is your current directory, there you can see all files on the directory.
This means that visual studio code is currently open on your old project, you say you didn't use it, but you probably opened vs code at some point on your project once, and vs code remembers.
You should make a new project to follow the tutorial. Go to File->Open Folder and pick a folder or make an empty folder and select it.
The reason why the tutorial's side bar says current project is because that is the name of the folder he's working on. so if you want to name your project that as well you should name the folder you open that.
Finally, to "find" the index.html file, as he explains in the video, this is just a very basic file, he made it before the tutorial started, it's not a vs code thing. You have to write the file yourself.
I hope my explanation was clear and solves your issue.

How can I add HTML code with notepad without installing an IDE

I am a starter in programming. One of my friends told me that I can start programing without installing any app and that I need only notepad to start learning HTML. The thing I can't find out is how I actually make it work. I inputted the code he gave me and I also made sure there where no typos, but then after I saved it I can not open it as a local file. I have only been able to open it as a text document so I can only see the code.
For this you have to save the file you are working on with the extension: .html. Then you have to open it with a browser, and you will see there the content of it
you can create a notepad and save it as name.html (not as .txt)
write the code inside it.
You can start with the notepad software. Unfortunately, this is not the best option. In fact, specialized software is recommended. Thanks to them, you will be able to write code faster thanks to the suggestions made by the software or to the very useful shortcuts! If you want to use this software, I recommend you one of the best on the market: Visual Studio Code.
If however you want to stay with notepad, you just have to click on "File" > "Save as" and to choose the type of file you want. In your case, it will be .html (Hypertext Markup Language)
You can create a file called [filename].html, and right click on it to open it in notepad. After Editing the file and adding your code to it, you can double click on it and it will open in your browser.
If you start enjoying to code, getting an IDE will make it much better. Visual Studio Code is recommended for this as it is user friendly and won't take up much storage space :)
code.visualstudio.com - Visual Studio Code
After saving the HTML code save it as filename.html, make sure that file extension is .html otherwise the filesystem will not recognized it.
Then right click on the file and open it with chrome or whatever browser you have and it will work, else open browser and drag it to browser and drop it, your html page will open in browser.

CSS issue in vs code

I'm new in VS Code and I'm trying to figure out what went wrong here because css won't work for me. The link is good because it opens with click + ctrl. Both files are in the same folder. So why isn't it working?
Edit saved:
Seems like you didn't save index.html. See the round dot? It means it's not saved.
Your code seems fine. Also, it's always better to use a browser than using built in preview.
Use an browser and save your files changes for see your proyect.
Save file and try opening it with a browser. I always prefer browser to test a file. Sometimes 2 browsers if it has a problem. I suggest you to use sublime text 3 or notepad ++ with vs code because it can save you from a lot of headaches. :)

ASP not running in .htm file in browser

I am attempting to run some asp code in a htm file however whenever I open the file it doesn't actually run the code but instead just displays the code without the '<%%>'. I've tried changing the file type to all sorts of things (.html, .asp, .aspx, .shtml) however none change anything and .asp doesn't even run (instead just displays the text as the the browser would when opening a text document).
I found some code on w3schools.com which is where I'm learning html however it doesn't work nor does the site mention any prerequisites for using asp code in an htm file.
The code:
<!DOCTYPE html>
<html>
<body>
<% response.write(request.querystring("fname")) %>
</body>
</html>
I have gone and ticked the ASP Windows features and whatever else related but that did nothing.
I am on a Windows 10, if that is relevant.
I am using opera (though I've tried opening in Window's Edge as well) and just opening via double-click or dragging into window. I am new to html in general so sorry for such a dumb question that may have already been answered before, I have searched a lot but after quite some time I decided to just ask.
I'm not sure what you are learning, but I think you might have come across Classic Asp. I'd recommend you download Visual Studio Community Version which you can find here
and instead try to learn ASP.NET.
However, if you want to launch your file you will need to use the local IIS. Simply go to START and in the search bar type IIS:
It should look like this:
On the left hand site, you will see SITES --> Right Click On it and point it to your Folder/File. Once it's there, then click on your SITE Folder in IIS and click on START which is on the right side with a red border. If it doesn't come up, click BROWSE *.443 which is right below it. It should launch.
If you are just starting, I'd suggest you download Visual Studio Code or ATOM and start creating simple .html files/website. It might be too overwhelming to go into ASP.NET or Classic before you become familiar with static .Html files.

Same HTML source files but display differently

I'm new to bootstrap. I want to use the bootstrap on my previous project. But once I included the bootstrap.min.css it failed, while it can work fine if I create a new html from scratch.
I've uploaded the sample files in GitHub: https://github.com/kid551/toolbox/tree/master/bootstrapSameFiles . You can check that the test.htm and test2.htm are the same files but they will display differently like this:
test.htm:
=============================
=============================
test2.htm:
=============================
=============================
I think you can rebuild this issue by directly downloading from GitHub.
I don't know why it happens and how I fixed this.
Thanks.
You're running into some encoding issues. Even though your code base seems to be the same - it isn't. Let me show you visually.
The moment I switch from UTF-8 to UTF-16 BE, your working versions (test.htm) code gets cryptic, while the other one seems to be pretty well working.
test.htm (UTF-16 BE)
test2.htm (UTF-16 BE)
So eventually you might have copied your code from somewhere else or even used a wrong encoding.
EDIT
You can test that with any editor which is able to show you some code. Just try to delete a linebreak by hitting backspace at the first index of a row. You'll notice on almost every row that you're not deleting the linebreak but an 'invisible character' instead. So that again means, you're just not able to see those charecters your editor is not able to encode properly.
I have downloaded your source from the GIT. You are right both are similar but there is something wrong with the test2.htm file. I have NetBeans installed on my local. When I open test2 file its showing source as empty in NetBeans.But if I open the same file using notepad++ it's showing the source. So maybe file is corrupted. What I suggest is try to create the new file or use NetBeans. After saving using NetBeans its displaying same as test.html