Webmaster Forum
Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > General > General Webmaster Talk
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs

UK Web Hosting
UK Web Hosting
Website Hosting
Website Hosting
UK One Way
UK One Way
Free Website Thumbnail Creator
 
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-12-2006, 08:33 AM
Rifat
Guest
 
Posts: n/a
iTrader: / %
Default Simple guide to CSS

This is tutorial/guide mainly for people who have minimal experience with CSS (Cascading Style Sheets) and want to learn a bit out about it. CSS is a stylesheet language that formats the presentation of a document written in a markup language (e.g. HTML, XHTML, XML). CSS has a number of advantages one of the main ones being the presentation of websites can be held in one place, therefore making it really simple to update webpages. Style sheets make sites load faster and doesn't use require much bandwith. CSS specifications are maintained by W3C (World Wide Web Consortium).

Adding stylesheets within the HTML file:
Quote:
<html>
<head>
<title></title>
<style type="text/css">
body {
color: white;
background-color: #000000;
}
</style>

</head>

<body>
[etc...]
</html>
Style sheets in CSS is made up of rules, and each of these rules has three parts to it.

- the Selector (example: 'body') : specifies which part of the document will be affected by the rule

- the Property (example: 'color' and 'background-color') : specifies what aspect of the layout is being set

- the Value (example: 'white' and '#000000'): gives the value for the property

Note: color values can be defined using hexadecimal notation to learn more about this go to this website - http://www.w3schools.com/html/html_colors.asp

Grouping selectors and rules:

Instead of having this:
Quote:
body {color: white}
body {background-color: #000000}
We can have this:
Quote:
body { color: white;
background-color: #000000 }
Just by using ';' to separate the properties.

OR

Instead of having this:
Quote:
H1 { font-style: bold }
H2 { font-style: bold }
H3 { font-style: bold }
We can have this:
Quote:
H1, H2, H3 { font-style: bold }
Will be adding more to this very soon.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 04-21-2006, 07:24 AM
Rifat
Guest
 
Posts: n/a
iTrader: / %
Default

Inserting a Style Sheet

There are a number of ways you can apply style sheets to a web page.

Inline styles:

To use inline styles you place a 'style' attribute in a HTML tag. The 'style' attribute can state any CSS information. Here is an example:

Quote:
<p style=”color: blue; font-sizer: 12pt”>
What a nice sentence this is</p>
You can see how inside the 'style' attribute the style sheet language format is similar to the examples above. You still need a ';' to seprate the properties.

Internal Style Sheets:

Usually internal style sheets are placed in between the head tags in a HTML document. With the use of <style> tags CSS can be applied. An example on an internal style sheet:

Quote:
<head>
<style type=”text/css”>
body {background-color: #900000;
text-family: arial;
text-size: 12pt}
</style>

</head>
Internal style sheets are usually used when the web master wants to give a certain look for a certain web page that differentiates from others in a web site.


External Style Sheets:


Probably the most popular way of applying style sheets, with external style sheets you create a separate document that contains all the CSS information. While in the HTML document <link> tags need to be placed so the browser can read the information from the style sheet document. The <link> tags need to placed in between the <head> tags.

Example:
Quote:
<head>
<link rel= ”stylesheet” type=”text/css” href=”funkstyle.css” />
</head>
In the 'href' attribute you insert the name of your style sheet file and the browser will read the information in that file and format accordingly. Your style sheet file needs to be saved with the .css extension. The style sheet document doesn't need any <style> tags because it has already been saved as a CSS extension. A simple example of what a style sheet file can look like:

Quote:
body {background-image: url(“image/discostu.jpg”);
font-family: arial;
font-size: 12pt}
p {color: blue;
font-family: aria}
h1 {font-size: 14pt}
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 04-21-2006, 12:51 PM
Pentarix
Guest
 
Posts: n/a
iTrader: / %
Default

Thanks Rifat, I found that helpful!
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-24-2006, 05:35 PM
etechsupport
Guest
 
Posts: n/a
iTrader: / %
Default

http://www.csszengarden.com/ nice site for CSS.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-24-2006, 10:23 PM
Stuey
Guest
 
Posts: n/a
iTrader: / %
Default

Quote:
Originally Posted by etechsupport
http://www.csszengarden.com/ nice site for CSS.
That's a great resource etetchsupport. It seems that you can apply templates to the basic innards of the site.

Thanks for that ;-)

Stuey
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 04-24-2006, 10:37 PM
OldWelshGuy's Avatar
Administrator
 
Join Date: Oct 2004
Posts: 2,236
iTrader: 0 / 0%
OldWelshGuy has much to be proud ofOldWelshGuy has much to be proud ofOldWelshGuy has much to be proud ofOldWelshGuy has much to be proud ofOldWelshGuy has much to be proud ofOldWelshGuy has much to be proud ofOldWelshGuy has much to be proud ofOldWelshGuy has much to be proud of
Default

Yep csszengarden is amazing. I have seen it a few times, and used it to demonstrate to clients the power of css. (not that I am any good at CSS

Hi Stuey, welcome to UKWMW
__________________
Umbrella Consultancy SEO WALES - Web Design Wales- Internet Marketing Consultancy - Google expert
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 04-25-2006, 12:47 AM
Stuey
Guest
 
Posts: n/a
iTrader: / %
Default

Quote:
Originally Posted by OldWelshGuy
Yep csszengarden is amazing. I have seen it a few times, and used it to demonstrate to clients the power of css. (not that I am any good at CSS

Hi Stuey, welcome to UKWMW
Thanks Old Welsh Guy,

I hope that I can learn from the forum members ..... and contribute :bonk:
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 05-03-2006, 09:18 AM
Rifat
Guest
 
Posts: n/a
iTrader: / %
Default

Theres another website on CSS, lots of CSS tricks: http://www.cssplay.co.uk
An example, this is a flyout transparent menu: http://www.cssplay.co.uk/menus/flyout_horizontal.html. And this is using jsut CSS.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 05-03-2006, 09:19 AM
Rifat
Guest
 
Posts: n/a
iTrader: / %
Default

Background Properties

In CSS background properties lets you set the background color for a web page and an image for the background. With the image background you are able to position the image, and also repeat the image horizontally or vertically.

Examples

Background Color:
Quote:
body {background-color: blue} -> Color Name Value

body {background-color: #0000FF} -> Hexadecimal Values

body {background-color: rgb(0,0,255)} -> RGB Values
All of these properties do the same thing, they set the background color of the web page to blue. People have a choice of how they assign their value.

Note: A link to CSS Color Values

Background Image:
Quote:
<style type="text/css">
body {background-image: url('waterbg.jpg')}
</style>
This basically assigns the image from the given URL, the URL is placed between brackets after the text 'url' as shown in the example.

Repeating a Background Image:
Quote:
<style type="text/css">
body {background-image: url('waterbg.jpg');
background-repeat: repeat-x}
</style>
This background image is repeated horizontally, to repeat the image vertically simply replace repeat-x with repeat-y.
Quote:
<style type="text/css">
body {background-image: url('waterbg.jpg');
background-repeat: repeat}
</style>
This repeats the image horizontally and also vertically.

Background Position:

The property for positioning images on backgrounds is; background-position. The values for background-position can be in the form of percentages (e.g. background-position: 100% 50%), length (e.g. background-position: 0px 30px), and keywords (e.g. background-position: right center). In all cases the horizontal position is specified first and the vertical position second. So for example the values 100% 0% will be positioned on the top right corner of the page.

Single Image on a Background:
Quote:
<style type="text/css">
body { background-image: url('circle.gif');
background-repeat: no-repeat;
background-position: center; }
</style>
With this a single image, in this case a little circle would appear in the center of the page.

To have the image fixed at a certain point so it will not scroll with the rest of the page, just add this property to the body selector; background-attachment: fixed.

This link directs to a table that contains most background properties and values: CSS Background Properties Table
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks

Webmaster Resources
UK Web Hosting
UK WW SEO Tools
Free site submission
Web Directory
 
Advertisement
Get top 10 exposure
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
2 column 2 columns 301 addtype advice bbpress bid bidding directory blog post british telecom broadband cheap chip maker community coupon code designs directory domain for sale domain name ecommerce ecommerce information ecommerce poll edegra fibre optic forum fraud free free portal script free script generate revenue generic viagra google graphics heaven intel internet spending james in london kamagra keywords layout link exchange links wanted linux and windows server local search modeling monopoly online retail online spending optimising owg in london parking photography php picture of the day purple robots.txt scour scripts search engine search quality site promotion special discount speed cameras submission theme usability web hosting website win a network wordpress

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Short guide to SEO lala General Webmaster Talk 9 04-25-2007 05:54 PM
SEO beginner guide. etechsupport General Search Engine Discussions 3 12-30-2005 09:08 PM
Please guide me thrue Dorra iG Shop 0 06-28-2005 01:37 AM
Installation Guide mikejames iG Shop 2 12-24-2004 03:36 AM


All times are GMT. The time now is 10:59 AM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100