Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

Basic CSS Tutorial

 
webmaster forum
Thomas  Offline
Formerly theone759.
Activity
0%
 
Professional Coder
Posts: 351
Topics: 53
January 16, 2009, 08:54:59 PM




Q & A:

1]   What does CSS Stand for?

      CSS Stands for Cascading Style Sheets

2]   What does it do?

      You can quickly change font, font size, background color/image, text layout, page margin and much more. (I will explain how to change some of those below!)

3]   Why should I use CSS (Cascading Style Sheets)?

      You can carefully control every aspect of your page(s).  Apply changes globally, with a consistent design throughout your web pages.

4]   Why does my page look different in different web browsers?

      Different browsers will display the CSS Markup differently, which is why you are noticing a difference in the different browsers. Some older browsers can’t display it correctly, or older browsers can’t display it at all.


5]    How do I use CSS, or where do I put the code?

      You can do it two different ways; you can have it inside your web page (will explain below), or link to a external styles.css.

CSS Markup Example(s):

*You can use this as you need to and alter it to your likings (Hope it helps!)

body {background: black;
color:  black;
font size:  16px;
font –family: Garamond;
margin-left:  72px;
margin-right:  72px;
margin-top:  72px; }

Explanation of what each part does:

-- Background: This is the background of your web page, so with that code, our background is black.
*Note you can change that using any hex code. For a list of web-safe colors visit: http://www.web-source.net/216_color_chart.htm.

-- Color:  This is your font color. You can’t change it to font-color, it needs to stay as “color”. Again, you can change this just like above.

-- Font-Size:  Pretty self explanatory, this is the size of your font.

-- Font-Family:  This is the look of the font, you can change this to another family:

*Note, it’s important to use one of the most common fonts, and they are usually installed on all computers. If you use one that others don’t have it won’t display correctly.

-- Margin-Left/Right/Top: This is the margin of your website (the width of your page [where the text begins and ends]).



So that’s the body of your page, which is the main part, but you can also edit other parts of your page, or edit different spots of your page, such as the header, body, footer, copyright, headings etc…Almost unlimited.



--How do I edit different areas of my web-page?

   Well, I’ll first start of how to change your headings (h1, h2 , h3 etc…)

So you would put this code underneath the body part:

 h1, h2, h3 {color=orange;
font-family:  Arial;
font-size:  20px; }

That will change all the headings to the color orange, the font Arial, and the font size 20. Again edit that your needs.


--How to edit the “footer” area (Change the footer to different name if you like, or edit it to your needs [be sure to edit everything]).

Inside your <body></body> tags, you would put this:

<p class=”footer”> (your text/info here)</p>   

That will separate it from the normal body markup we did earlier, so you can edit this area differently (Note: If you do not add any new markup for the Footer area, it will be the same as the body markup)
To change the Footer area, you would put this under the h1, h2, h3 markup, or the body markup if you are not using the h1, h2 etc…code.

p.footer {font family: Arial;
font-size: 16px;
background: yellow;
color: purple;}

The same meanings that were for the body, also apply for this, and any other time you are using these tags.
Note: You can use that piece of code for many different areas of your web-page. Just edit it to your needs.

--How to put this into your web-page?

If you remember, I stated above that there are two ways you can use this: External and Internal.
To  put this markup into your webpage with no extra files, or any other things except of your webpage (example.html).
Put this code underneath your <title></title>

<style type=”text/css”>
Your markup here
</style>

How to import a cascading style sheet into your web-page?

Note: You have to put the markup you want into notepad, or another text editor that you have then save it as styles.css , then upload into the same directory with your web-page.

So, after you have your styles.css saved, you can now put this code into your page underneath the <title></title> tags.

<link rel=”stylesheet” type=”text/css” href=”styles.css” />

That will give the same effect as if you had the markup inside your document.


So that’s it. A tutorial on how to use simple CSS.

Any questions please post below, and I will answer them ASAP.


All written by theone759, with reference to the book HTML, XHTML & CSS For Dummies





Article Source: http://www.TechnicalTalk.net




You can find more information here :-



*** Please do not forget to leave your comments about this article ***

« Last Edit: February 04, 2010, 12:09:09 PM by Admin »
 
webmaster forum
shefeekj  Offline
For Technical Information
Activity
0%
 
New Coder
Posts: 26
Topics: 11
WWW
April 14, 2009, 09:42:54 PM

good for newbies ....keep writing

http://www.shefeekj.com
 
webmaster forum
jesila  Offline
Activity
0%
 
New Coder
Posts: 29
Topics: 0
June 04, 2010, 11:00:31 AM

I think you are doing a great job the way you have explained is awesome. keep doing.
« Last Edit: December 03, 2011, 10:12:35 AM by Admin »
 
webmaster forum
Activity
0%
 
Regular Coder
Gender: Female
Posts: 85
Topics: 15
June 07, 2010, 09:04:04 AM

good resource for starting CSS technique .
i had an overall look on CSS before just for curiosity P
any way
good introduction and thanks for the tutorial
keep it up Smiley

I'm trying to express myself Smiley

my blog: http://www.libertydash.blogspot.com/

smashwords: http://www.smashwords.com/books/view/91236
 
webmaster forum
kamentoro  Offline
Activity
0%
 
New Coder
Posts: 15
Topics: 0
kamentoro
WWW
November 03, 2010, 08:17:50 PM

do not forget about the browser compatibility because every browser maybe have their own css

how to cure fingernail fungus naturally?
 
webmaster forum
Admin  Offline
*
 
Code Guru
Location: India
Gender: Male
Posts: 1387
Topics: 105
NaviBuster NaviBuster
WWW
November 04, 2010, 11:59:27 PM

All browsers are developed using different different techniques and at the same time every year some new browsers are launched in to the internet world. Therefore good designer should test his/her designs on few popular browsers before showing it to rest of the world.
 
webmaster forum
Activity
0%
 
New Poster
Posts: 11
Topics: 0
WWW
January 25, 2011, 03:53:21 AM

good detail for newer.  keep adding more information
 
webmaster forum
Life Is Good!
Activity
0%
 
Professional Coder
Gender: Female
Posts: 242
Topics: 3
WWW
June 09, 2011, 07:40:26 AM

wow, thanks for this tutorial.. Smiley

Affordable Custom Web Design Services
 
webmaster forum
prasana  Offline
Activity
0%
 
New Poster
Posts: 8
Topics: 3
September 05, 2011, 06:40:59 AM

hello. . .
    can u give more examples about this. . . . . Huh??
               and please give some detailed explanation about this. . . . . . . .
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page January 25, 2012, 09:12:48 AM