How do i use html codes? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do i use html codes?

I created an html code(myFirstPage.html) which works excelent but just on playground(SoloLearn site) I tryed to rewrite that on a computer-text-editor and then openned that text with a web-browser but that opened just as an html-text How do i run that? I apreciate your help in advance.

11th Dec 2016, 9:28 PM
irajjs
irajjs - avatar
13 Answers
+ 3
Directly from the file system, try dragging the file (mouse drag and drop) into a browser window. Otherwise adjust to fit (note THREE slashes: The first two are attached to the PROTOCOL file://. The third one is "directory root". Windows: file:///c/users/you/desktop/file.html Linux (OSX similar) file:///home/you/Desktop/file.html Android: file:///sdcard/file.html Or you could install a basic webserver (IIS, Apache, nginx, python test webserver), copy the file to webroot and: http://localhost/file.html The file should start with some form of <html> and the extension should be .htm/.html so MIME types work as expected. Windows Notepad will tack on ".txt" to ".html" (so: "file.html.txt") unless you force it to name it what you say by writing "file.html" (use ") the first save. If you've already done this on Windows show extensions (an explorer setting) and get rid of ".txt" which confuses browser MIME typing. Upvoting Sublime Text; avoid document processing editors. * None of this requires you to be "online".
11th Dec 2016, 10:10 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
Abiword is document processing program. Use a text editor. While the choice depends, I suggest Sublime. Don't use Abiword or MS word, etc.
11th Dec 2016, 10:02 PM
Rishi Anand
Rishi Anand - avatar
+ 1
Shouldn't be so. Still, insert this <!DOCTYPE html> at the top of every html document. And one thing else. Did you save the file with .html extension?? What text editor you were using?? MS windows had a stupid setting to hide the extensions from file names. And if you use the notepad, it generally saves the file with .txt extension
11th Dec 2016, 9:49 PM
Rishi Anand
Rishi Anand - avatar
+ 1
Or, If you would prefer an online alternative, use Mozilla thimble. Great thing.
11th Dec 2016, 10:04 PM
Rishi Anand
Rishi Anand - avatar
+ 1
Good luck mate.
11th Dec 2016, 10:49 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
I understood that it has been my own mistake! I had created a text file .. then i used that to write the code by using abiword .. I must have created an html file .. i did not know that Solved now! Thank you.
14th Dec 2016, 2:20 AM
irajjs
irajjs - avatar
0
did you save it as .html or left it as .txt ?
11th Dec 2016, 9:46 PM
Demeth
Demeth - avatar
0
I saved that as .html .. maybe i should have been online!
11th Dec 2016, 9:51 PM
irajjs
irajjs - avatar
0
I saved that exectly as shown in the original question but - working with that ..i saw a possibly alternative form which had : <!Dostype.. - I used abiword text editor and then used firefox version33 but just offline!
11th Dec 2016, 9:59 PM
irajjs
irajjs - avatar
0
OK just let me examine adding <!DOCTYPE html> i need few minutes
11th Dec 2016, 10:07 PM
irajjs
irajjs - avatar
0
use the meta encoding
11th Dec 2016, 10:33 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
My computer is in an extra ordinary state ..i am not going to discuss about that now! .. this can be considered as an explanation! any how i tried to open that with bluefish text editor ... there were a lot of more codes added .. possibly by abiword .. including : <!DOCTYPE html> .. etc Then i tried : LiberOfficr Writer ..but that program scaped! I can not use kwrite which was my usual editor ... recently it had got a problem and does not work .. Finally i returned to abiword! but it said : can not open that file because it is an invalid document! I had created that file with abiword and had openned that with the same editor several times! I think and understood that all this is relared to the extra ordinary state of my computer .. I have been busy with programming during the last few years .... this is just an answer and the only explanation thank you for your help I must solve the problrm myself because it is out of this discussion
11th Dec 2016, 10:48 PM
irajjs
irajjs - avatar
0
I draged that to the browser window ... no change It is an additional last explanation : Tens of unknown processes have been active in my computer ... they are my own applications suppressed by OS! I also will not connect to Internet until i am done with my work which is creating an intelligent OS .. More explanations available in : linuxquestions.org/irajjs Thank you all again Regards
11th Dec 2016, 11:11 PM
irajjs
irajjs - avatar