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.
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".
+ 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.
+ 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
+ 1
Or, If you would prefer an online alternative, use Mozilla thimble. Great thing.
+ 1
Good luck mate.
+ 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.
0
did you save it as .html or left it as .txt ?
0
I saved that as .html .. maybe i should have been online!
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!
0
OK just let me examine adding <!DOCTYPE html>
i need few minutes
0
use the meta encoding
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
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