How to Change/Add Snippets for Atom? - html

How do I change or add snippets in atom?
I want to change:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>
To this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>
And I'd also like to know how to add snippets like these. Thanks!

> On your snippets.cson file add the following code:
>'.text.html.basic': 'HTML':
> 'prefix': 'myhtml'
> 'body': '<!DOCTYPE html>\n<html>\n<head>\n\n\t\t<meta charset="utf-8">\n\t\t<title></title>\n\n</head>\n<body>\n\n\n\n</body>\n</html>'
>
> NOTE: value in the body section should be in one single line.

Related

cannot pass value from one html to another html page using href

i cannot pass my value from one html page to another html using href link. please help to suggest is there any way i can do to get the link ? following is my code:
page1 html
<!DOCTYPE html>
<html>
<head>
<title>Node.js app</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
Visit W3Schools!
</body>
</html>
page2 html
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script>
const urlParams = new URLSearchParams(window.location.search);
const PayValue = urlParams.get('value');
console.log(PayValue);
</script>
<h1>this is second page value:PayValue</h1>
</body>
</html>

Setting black for one line - There are more web links on the line

I'm trying to set black for one line. There are more web links on the line. But the link is still blue. Thanks for the help.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Titulek stránky</title>
</head>
<body>
<h2 style="color:black;">YouTube Google</h2>
</body>
</html>
Because there is a default style from <a> tag, which it hides the set style from <h2>. There are 2 ways (not only 2) to resolve the problem.
Way 1: by adding a <style> tag and put your styles inside it.
<html>
<head>
<meta charset="utf-8">
<title>Titulek stránky</title>
<style>
a {
text-decoration: none;
color: black;
}
</style>
</head>
<body>
<h2>YouTube Google</h2>
</body>
</html>
Way 2 (not recommended because it looks not really tidy): add styles to each <a> tag.
<html>
<head>
<meta charset="utf-8">
<title>Titulek stránky</title>
</head>
<body>
<h2>
YouTube
Google
</h2>
</body>
</html>
Hope helped.

DOCTYPE and Character Encoding not recognized by w3.org validator

I've spend several hours trying to figure out what's wrong with the following html.
<!DOCTYPE=html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Location Status</title>
<link rel="stylesheet" type="text/css" href="location_status.css">
<meta http-equiv="refresh" content="900">
</head>
validator w3.org tells me:
The character encoding was not declared.
End of file seen without seeing a doctype first. Expected <!DOCTYPE html>
Element head is missing a required instance of child element title
Your <!DOCTYPE html> wasn't right and you forgot to close the <html> tag.
Here's the code in the right format:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Location Status</title>
<link rel="stylesheet" type="text/css" href="location_status.css">
<meta http-equiv="refresh" content="900">
</head>
<body>
// Your page code here
</body>
</html>
You have forgotten to close your <html> tag. You should always remember to close the html tags otherwise it can create unecessary problems.
You have not used <!DOCTYPE html> correctly.
<head> requires a <title> tag which specifies the title of your page and it will appear whenever you will open your html page in the browser.
Generally <head> contains all the metadata.
You can do like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title of your page</title>
<link rel="stylesheet" type="text/css" href="yourCSSFile.css">
<meta http-equiv="refresh" content="900">
</head>
<body>
// Your Code
</body>
</html>

html5 coding redirect not working

I am trying to redirect to another page here and it will not go when I test it both files are in the same folder on my computer
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8/>
<meta http-equiv="refresh" content="4; url=home.html" />
</head>
<body>
<h1>Welcome to BlazeFirer's Website</h1>
</body>
</html>
other page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Blazefirer</title>
</head>
<body>
hello
</body>
</html>
Close your charset meta tag properly, it's missing quotes afterwards.
<meta charset="UTF-8/>
Should be
<meta charset="UTF-8"/>

How do I change JSP and HTML indentation style in Eclipse?

When I apply the automatic indentation in Eclipse IDE, on HTML or JSP files, I have that:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Test</title>
</head>
<body>
<p>Test.</p>
</body>
</html>
But I would like to have that :
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Test</title>
  </head>
  <body>
    <p>Ceci est une page générée depuis une JSP.</p>
  </body>
</html>
So I dont know how to add a tab after head and html ?