[Tutorial] Your first Web Design

Status
Not open for further replies.

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
This tutorial is for people who want to get into web designing and who are confused on how to start.

This will not be a fancy tutorial, but it will indeed be helpful. Let's start.

First, we will make the index file, it will be called index.html
in this file we will be using an external style sheet, which means all the CSS code will come from another file, named style.css
After you've made the file add this into it:
Code:
<html>
<head>
<title>Inspiration</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

</body>
</html>
Now, in this code it all looks familiar, the HTML, head and body tags are in pretty much all web pages, but what is this?
Code:
<link rel="stylesheet" type="text/css" href="style.css" />
That is an external style sheet, this calls the CSS code from a file called style.css, note that you can also use an internal style sheet, but I will be using an external style sheet in this tutorial.

Now, let's create the style.css, which will send the CSS code to index.html.
After you have created style.css it's time to code some stuff!
Let's start by adding some color.

Code:
body /* Name of the tag [I] Note: This does not have a '.' or a '#' like divs, this is the <body> tag in our index.html [/I] */
 {  /* We start the code with a curly bracket */
background-color:#dedede; /*We add some color to the background */
} /* We end the code with a curly bracket */
That would give you a light gray background!
Ok, but what if we want to add boxes and stuff?

Well, to create content boxes we will use divs, there are 2 'types' of divs, the divs with an id and the divs with a class.

Divs with id:
HTML code:
Code:
<div id='box'> /* Start the div named box */
zOMG this a box
</div> /* Close div */

CSS code:
Code:
#box {
background-color:#000000; /* This box will have a black background */
color:#FFFFFF; /* The color of the letters will be white */
height:50px; /* This box will be 50px tall */
width:100px; /* This box will have 100px of width */
border-color:#FFFFFF; /* This box will have a white border */
border-style:solid; /* The border will be solid (Type of border) */
border-width:1px; /* The border will have 1px of width */

Divs with class:
HTML code:
Code:
<div class='box'> /* Start the div named box */
zOMG this a box
</div> /* Close div */

CSS code:
Code:
.box {
background-color:#000000; /* This box will have a black background */
color:#FFFFFF; /* The color of the letters will be white */
height:50px; /* This box will be 50px tall */
width:100px; /* This box will have 100px of width */
border-color:#FFFFFF; /* This box will have a white border */
border-style:solid; /* The border will be solid (Type of border) */
border-width:1px; /* The border will have 1px of width */

This are the basics on how to make a website design, I'd suggest you go to and learn margin, padding, etc.

Hope this was helpful!
 

Jo$h

Posting Freak
Jul 7, 2010
1,030
79
Very Nice Tut... I also have some CSS tuts that will go deeper in-depth as I write them...
 

Qurb

Member
Sep 11, 2010
38
3
Thank you Kryptos, really good tutorial, it helped me quite a little bit because I have trouble with CSS. :)
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
Thank you Kryptos, really good tutorial, it helped me quite a little bit because I have trouble with CSS. :)

No problem :)

If anyone has a problem with CSS just PM me and I'll help you or I'll post a tutorial about your issue.
 

Benden

maging ang maganda mamatay
Jun 4, 2010
2,286
1,482
What is the defferance of divs with id and divs with class?
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
wel how do i make those expand? give me that source oftopic

You mean how to make the boxes expand? If yes, then just remove the 'height: 50px;' and it will have the height of the content inside of the box.
 

Notice

Member
Nov 27, 2010
99
0
this was some result i was also working on the padding and the marging


naamlooswb.jpg
 
Status
Not open for further replies.

Users who are viewing this thread

Top