Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Publication Station
Search
Editing
Courses/single-page-portfolio
(section)
From Publication Station
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Preparing your folder and our files == The first thing you have to understand is that everything that we'll be writing is basically plain text. This means that your entire website basically consists of text files that are written in a specific way. You could even use a very basic text editor like textedit or notepad. However, programs that are specifically made for writing code often have handy features. Therefore, it's better to use a program like Sublime Text, that gives you a few handy code editing features. First, you should '''create a folder''' in which you'll be keeping all of your files. Call it whatever you like. After this, you open Sublime Text. '''Write''' anything you like and then '''save it as index.html''' in the folder you just created. Now find this file in finder and '''open it with a browser''', preferable Chrome. You just created a website! But to give it structure and make it look good, we'll need to write some html. Erase your previous text and proceed with the next step: creating the basic html structure. === Doctype, html, head and body === Open your index.html again in Sublime Text. Start by declaring the doctype on the first line. This tells the browser that the document will be written in HTML. After this, it's always smart to immediately write all the necessary tags you always need for an HTML document. This includes the html tag, but also the head and the body. In the head you will include information for the browser, like the document title and links to stylesheets and javascript files. In the body you place the html that people will really see. <source lang="html5"> <!DOCTYPE html> <html> <head> <title>My title</title> </head> <body> My content </body> </html> </source> === Adding a CSS file === Now we want to style our content. To do this, we first have to add a link to a stylesheet in the head of index.html like so: <source lang="html5"> <head> <title>My title</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> </source> You can see that we are linking to "style.css", so this is the file we will have to create. Open a new file in TextWrangler and add the following text: <source lang="css"> body{ background: red; } </source> This makes the background of our site red, just to see if it works. Save this file as "style.css" and save it in your folder. If you open index.html in your browser again, you should see that the background is now red.
Summary:
Please note that all contributions to Publication Station are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Publication Station:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Main navigation
Main page
Printmaking Studio
Print Studio
Dig. Publishing Studio
Namespaces
Grafiwiki
Random Page
Log in
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs