Welcome to Dream.In.Code
Become an Expert!

Join 150,007 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,373 people online right now. Registration is fast and FREE... Join Now!




Programming Reference Sheets: CSS

 
Reply to this topicStart new topic

Programming Reference Sheets: CSS, CSS Reference sheet, started as promised

William_Wilson
28 Nov, 2006 - 08:03 PM
Post #1

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
CSS stands for Cascading Style Sheets

/* comments */

all numbers in css can be written dynamically as a percent #(%) or as a static pixel count (#px)
-other supported measurements include: in, cm, mm, em (current element font size), ex (half current font height), pc (pica)

colors can be specified by #rrggbb notation or rgb(rr,gg,bb) notation [numbers or %] or with 1 of 147 supported color names

the last attribute within an ID, class, etc does not require a ;, the ending } is enough

you may also join commands to the same attribute list: h1,h2{}


//inline code in head /head tags:
<style type="text/css">
<!--css code here !>
</style>

//seperate file css in head /head tags:
<link href="file_name.css" rel="stylesheet" type="text/css">

//create ID:
#id_name{ //attributes; }

//ID use:
<div ID="id_name"></div>
//all items in the div will have attributes of id_name

//attatching attributes to existing commands:
//by leaving out the # it is assumed each time key word is typed
body { //attributes }
a { //attributes } //includes all commands: p, table, tr, td, etc

//create classes (ex for p command):
p.name_of_class { //attributes; }

//use classes:
<p class="name_of_class"> //since it is attatched to p, only the p command can invoke this set of attributes


//Attributes:
//*Note that the ordering of attributes can change the look of the end result
padding: #,#,#,#; //universal padding (top, left, bottom, right)
padding-left: #; //left padding
padding-right: #; //right padding
padding-top: #; //top padding
padding-botton: #; //bottom padding

position: keyword; //replace keyword with one of:absolute, static, relative, fixed
//absolute requires the placement be given eg: left #; top #;

margin: #; universal margin
margin-top: #; //top margin
margin-left: #; //left margin
margin-right: #; //right margin

//background (used in the body{})
background-image: url('image.jpg'); //sets the background to image.jpg

//repeat the image:
background-repeat: repeat; //to repeat vertically use repeat-y, and horizontal repeat-x
//to ensure no repeat use no-repeat
//to keep the image from moving use fixed

//position a single background image:
background-position: center //or left, right, top, bottom

//boders:
border-style: dotted; //other styles available: dashed, solid, double, groove, ridge, inset, outset

//boder colors:
border-color: #000000
border-color: #000000 #000000
border-color: #000000 #000000 #000000
border-color: #000000 #000000 #000000 #000000 //each sets pairs or single colors

//lists:
list-style-type: disc; //also available: circle, square, none
list-style: url('image.gif') //supply your own image for bullet points




i noticed little work being done on the php reference sheet, so i posted a long list there, now i've started this one smile.gif

txt file of above:Attached File  CSS_Reference_Sheet.txt ( 2.7k ) Number of downloads: 107


This post has been edited by William_Wilson: 28 Nov, 2006 - 08:05 PM
User is offlineProfile CardPM
+Quote Post

ReggaetonKing
RE: Programming Reference Sheets: CSS
28 Nov, 2006 - 09:00 PM
Post #2

D.I.C Head
Group Icon

Joined: 16 Nov, 2006
Posts: 73



Thanked: 1 times
Dream Kudos: 100
My Contributions
Pretty good!
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Programming Reference Sheets: CSS
29 Nov, 2006 - 08:19 AM
Post #3

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
thanks, i didn't have that much time to work on it so i may go over it and explain things better
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: Programming Reference Sheets: CSS
20 Aug, 2007 - 07:47 AM
Post #4

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 15,277



Thanked: 61 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
William, we can finish this up if we can add some more... maybe some more styles (i.e. fonts, positioning, etc.)
User is online!Profile CardPM
+Quote Post

static-dragon
RE: Programming Reference Sheets: CSS
29 Aug, 2007 - 09:37 AM
Post #5

New D.I.C Head
*

Joined: 10 Jul, 2007
Posts: 43


My Contributions
looking pretty good, the finish product will be great to have on hand
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Programming Reference Sheets: CSS
12 Oct, 2007 - 01:06 PM
Post #6

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
It is now listed as a google doc (i also fixed the spelling mistakes)
http://docs.google.com/View?docid=ddzd3jc2_0hmhws6

if anyone wants to post some of the necessary additions feel free, otherwise i'll get to it in a week or so.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 08:40PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month