Creating a website in html not xml - html

Call me crazy but I have been trying to make an HTML website using Visual Studio 2012 but every time I open the program and create a webpage it automatically makes it an XML. Is this normal? Is this the normal start to an HTML webpage or do I need to do something to change it?
I have looked through the Microsoft webpages help and the Visual Studio help and I cannot find anything that explains this to me.
All I want to do is make an HTML website
<head>
<style>
</style>
</head>
<body>
<h1></h1>
<h2></h2>
</body>
</html>
I know I can do this using a notepad.
Thanks for any help.

That is not XML brother. That is what HTML is like. Anywhere you go, you'll find the same pattern, and so does Visual Studio follows.
<html>
<head>
<style>
</style>
</head>
<body>
<h1></h1>
<h2></h2>
<p></p>
</body>
</html>
That is HTML, you don't need to do anything just add the content for the heading or paragraph elements. XML is something else, if you're confused you should first atleast try to check what's the difference here. :)
Good luck!

Related

Why is Live Server only loading half my HTML code?

I have searched the internet for hours trying to find someone else who shared my issue, but it seems to be entirely unique to me.
So basically, I launch my very small HTML file with live server, but only 2 divs are loaded on the webpage, and I have no idea why. I have tested it and narrowed it down to purely being an issue caused by live server, as my html file loads completely fine when the file itself is double-clicked on from file explorer, and I still have the issue when i remove my links to my css and js files from the hmtl file.
this happens on the simplest of code, and its so annoying.
here is some simple code:
and here is the screenshot of the elements not loading:
and i also show the "code injected by live server" bit, cause i think that might be the issue?
please help, this is driving me crazy.
ps. i am a newbie to live server and website making.
There can only be one body tag in whole HTML file.
You can try this instead :
<html>
<head>
<title>HTML page</title>
</head>
<body>
<div>
<p>text</p>
</div>
<div>
<p>text</p>
</div>
<div>
<p>text</p>
</div>
<div>
<p>text</p>
</div>
</body>
</html>

Embedding websites inside a shell application using Angular 2.0.0

In the project, I'm working on we have 4 individual websites and one shell to host all. The team is using Angular 2.0.0. Their approach they choose is embedding each website inside shell application (Using object tag). So that the Dom in high level look like
<html>
<head>
</head>
<body>
<object type="text/html" data="http://website1.com/#/" style="width:100%; height:100%">
<html>
<head>
</head>
<body>
Content of the Website 1
</body>
</html>
</object>
</body>
<html>
I am working as a FE dev and to me, this sounds so wrong! why? because I have html { with: 100%, width: 100% } and because we have 2 html tag nested it ruins the style. I believe there must be a better to just embed the content of the websites1.
Would you please give me your thoughts about the best way to do this and potentially not having 2 html and body tags nested.
I'd appreciate

Notepad ++ basic programming EVERYTHING BOLD

Ok, please don't hate me for my idiocy. I'm literally beginning programming html RIGHT NOW. so, first problem.
I am following a simple guide to learn the basic html formats and this is all I have:
<html>
<head>
<title>www.fuyah.com</title>
</head>
<body>
<div id= "Header" class = "shared_elements">
<!--#divs don't really do anything, just for organization and targeting with css-->
<h1>The Adventure Begins<h1>
<span> this is my page. </span>
This is the beginning down my road of web development. It begins with one step...
</div>
</body>
</html>
For some reason when I look online at my page, everything is bold. I'm not sure why.
You haven't closed your <h1> tag and also <span "> there's unnecessarily " in there
<html> <head> <title>www.fuyah.com</title> </head>
<body>
<div id= "Header" class = "shared_elements">
<!--#divs don't really do anything, just for organization and targeting with css-->
<h1>The Adventure Begins</h1>
<span > this is my page. </span>
This is the beginning down my road of web development. It begins with one step...
</div>
</body>
</html>
Open your file in notepad and verify the contents before uploading the file.
If your see the file contents differently, do a "view source" in the the browser to see the contents.

Why does innerHTML behaves differently when it has <html> as a content?

Can anyone tell me why special here?
<html>
<head>
<script src="editor.js"></script>
</head>
<body>
<div id="scripts" class="scripts">
Editor.Execute('<html>Html String</html>');
Editor.Execute('<something>Html String</something>');
</div>
</body>
</html>
document.getElementById("scripts").innerHTML shows something however html dissapears.
Execute('Html String');
Execute('<something>Html String</something>');
It behaves the same way in Firefox and Chrome.
You're running into this issue.
Basically, the browser sanitizes out the HTML tags before your JavaScript can even access the page – you can check in the Chrome elements inspector, your <html> tag is not there.
I guess the answer depends on what exactly you're trying to do, but if you're just trying to output that code onto a web page, you can just escape the characters:
<html>
<body>
<div id="scripts" class="scripts">
Execute('<html>Html String</html>');
Execute('<something>Html String</something>');
</div>
</body>
</html>
Then document.getElementById('scripts').innerHTML will output:
Execute('<html>Html String</html>');
Execute('<something>Html String</something>');
And then you can replace the HTML entities in JavaScript.
Without knowing what you do in that Execute() it is hard to say what is going on there.
Just in case: HTML document can have one and only one <html> node.

Why does Chrome Developer Tool add elements not in the file?

When I have a simple HTML markup like this:
<!DOCTYPE html>
<html>
<head>
<title>lawl</title>
</head>
<body>
</body>
</html>
When viewing the elements of the document, in the Chrome Deceloper Tool(F12) it looks likes this:
<!DOCTYPE html>
<html>
<head>
<title>lawl</title>
<style type="text/css"></style> <-- what the?
</head>
<body>
</body>
</html>
So, my question goes: Where does the style tag come from? What added it, and why?
Hope you guys can clear this up for us, it's been quite the subject the last 10 minutes in class ;-). Also worth mentioning; a class got added to a empty div in another document when the teacher tried it.
Edited title.
Chrome plugins can get access to your DOM, and so does the development tools. In this particular case, I think the development tools is the one to blame.
The empty style tag is probably a placeholder for injected CSS.
If you open the source code (view-source:www.example.com), you will see that your DOM is perfectly fine.
99:1 that the <style> element is a stylesheet injected by your AdBlock (or similar) extension.