Create First Web Page
All webpages need a few basic elements. The elements are the <!DOCTYPE html>
that tells the browser the type of document it is working with, the <html>
that contains all other elements of the html document, the <head>
that acts as a container for the meta data elements, the <title>
that defines the title of the document, the <body>
that contains the body of the document. A basic webpage will resemble the following:
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1> Hello World </h1>
<p>This is a paragraph for a hello world document.</p>
</body>
</html>
Adding CSS
CSS is often used to define the style and layout of a webpage. CSS can be implemented either inline of in an external style sheet. It is recommended to do most if not all of the formatting for a document in an external style-sheet so that the user can view the information without the added formatting if desired. You would want to place the information in between the <head> </head>
elements using <link rel="stylesheet" type="text/css" href="style.css">
element to define the location of the external file relative to the current html document. There are to many properties and elements to cover, but more information can be found at W3.org. An example of a basic style sheet is as follows that just gives an example of how and external style-sheet can change the color of different elements of a html page.:
@charset "utf-8";
body{
color:#000
}
html {
color:#fff
}
p {
color:#red;
}