![]() |
|
#1
|
|||
|
|||
Simple guide to CSSThis 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: HTML Code:
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: CSS Code:
We can have this: CSS Code:
Just by using ';' to separate the properties. OR Instead of having this: CSS Code:
We can have this: CSS Code:
Will be adding more to this very soon. Last edited by admin : 12-Apr-2006 at 02:30.
Reason: Please use appropriate bbcodes for [css] and [html]
|
|
#2
|
|||
|
|||
Re: Simple guide to CSSInserting 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: HTML Code:
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: HTML Code:
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: HTML Code:
CSS Code:
Last edited by cable_guy_67 : 21-Apr-2006 at 06:31.
Reason: Please enclose html or css code in [html] ... [/html] or [css] ... [/css] tags
|
|
#3
|
|||||
|
|||||
Re: Simple guide to CSSBackground 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:
Note: A link to http://www.w3schools.com/css/css_colorsfull.asp Background Image: Quote:
Repeating a Background Image: Quote:
Quote:
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:
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: http://www.w3schools.com/css/css_background.asp |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UpdateData - simple MFC project | kobycool | MS Visual C++ / MFC Forum | 3 | 23-Oct-2005 02:45 |
| Simple Calculator Application | MOHAMMEDALI1989 | Java Forum | 1 | 06-Oct-2005 17:00 |
| Just need one simple example or link to such example | Doggonit | MySQL / PHP Forum | 2 | 31-Jul-2005 18:39 |
| IRC Services Admin help guide | Allowee | Open Discussion Forum | 2 | 25-Apr-2004 08:32 |
| Generating simple URLs for search engines | jrobbio | MySQL / PHP Forum | 1 | 17-Mar-2003 11:22 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The