Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Thursday, September 13, 2012

CSS Cheat Sheets






Source:
All The Cheat Sheets That A Web Developer Needs

Tuesday, July 21, 2009

Specificity and Star Wars

Specificity is a type of weighting that has a bearing on how your cascading style sheet (CSS) rules are displayed.”
“All rules in your CSS carry a specificity rating regardless of selector type, although the weighting that is given to each selector type varies and will ultimately affect the styling of your web documents.”
http://www.adobe.com/devnet/dreamweaver/articles/css_specificity.html


CSS Specificity: Things You Should Know

CSS Specificity Tools & Resources

  • CSS Specificity for Poker Players
    If you’re not from the programming world and CSS seems a bit confusing, perhaps this analogy may help clear some concepts up. Think of CSS rules as poker hands. The best hand determines an element’s style.
  • CSS specificity calculator
    Calculates the specificity of a given selector.
  • Understanding Specificity Tutorial
    In this tutorial you will look at specificity. Specificity is a type of weighting that has a bearing on how your cascading style sheet (CSS) rules are displayed. All rules in your style sheet carry a specificity rating regardless of selector type, although the weighting that is given to each selector type varies and will ultimately affect the styling of your web documents.
  • Cascade Inheritance: Specificity
    At this point it might be timely to have a quick discussion of specificity. Both inside a single style sheet, and in a cascade of style sheets, it should be clear that more than one rule can apply to the same element. What happens when two properties in separate rules which both apply to an element contradict one another?
  • CSS 2.1 Selectors Explained
    An extensive overview of CSS 2.1 selectors. Learning how to use the full range of CSS selectors available in CSS 2.1 properly can actually help you keep your HTML a lot cleaner. It will let you minimise unnecessary use of the class attribute and the need for adding extraneous div and span elements to the markup.
  • CSS Specificity Bugs in IE
    A brief overview of specificity bugs implemented in Microsoft Internet Explorer/Win.
  • CSS Structure and Rules
    Basic Syntax, Pseudo-classes and Pseudo-elements, Cascading Order.
  • Specificity
    It may not seem like something that important, and in most cases you won’t come across any conflicts at all, but the larger and more complex your CSS files become, or the more CSS files you start to juggle with, the greater likelihood there is of conflicts turning up.

Sunday, July 12, 2009

Master Stylesheet vs Global Resets

Trackback: http://www.crucialwebhost.com/blog/master-stylesheet-the-most-useful-css-technique/trackback/

The problem with Global Resets is that when set form buttons and fieldsets and a few other elements lose their original styling beyond recognition.

A better option is to individually style the elements that you want to reset. It also makes it easier to apply your own style to common elements.

Below is a basic master stylesheet that has some styling removed, such as color, removed to keep it simple and customizable.

The global classes at the bottom cover basic styling and will remove styling that was initially set. For example, the .nobullet and .noindent work great on an unordered or ordered list.
This is the place to add the classes that are commonly used.


  1. /***** Global Settings *****/
  2. html, body {
  3. border:0;
  4. margin:0;
  5. padding:0;
  6. }
  7. body {
  8. font:100%/1.25 Arial, Helvetica, sans-serif;
  9. }
  10. /***** Headings *****/
  11. h1, h2, h3, h4, h5, h6 {
  12. margin:0;
  13. padding:0;
  14. font-weight:normal;
  15. }
  16. h1 {
  17. padding:30px 0 25px 0;
  18. letter-spacing:-1px;
  19. font-size:2em;
  20. }
  21. h2 {
  22. padding:20px 0;
  23. letter-spacing:-1px;
  24. font-size:1.5em;
  25. }
  26. h3 {
  27. font-size:1em;
  28. font-weight:bold;
  29. }
  30. /***** Common Formatting *****/
  31. p, ul, ol {
  32. margin:0;
  33. padding:0 0 1.25em 0;
  34. }
  35. ul, ol {
  36. padding:0 0 1.25em 2.5em;
  37. }
  38. blockquote {
  39. margin:1.25em;
  40. padding:1.25em 1.25em 0 1.25em;
  41. }
  42. small {
  43. font-size:0.85em;
  44. }
  45. img {
  46. border:0;
  47. }
  48. sup {
  49. position:relative;
  50. bottom:0.3em;
  51. vertical-align:baseline;
  52. }
  53. sub {
  54. position:relative;
  55. bottom:-0.2em;
  56. vertical-align:baseline;
  57. }
  58. acronym, abbr {
  59. cursor:help;
  60. letter-spacing:1px;
  61. border-bottom:1px dashed;
  62. }
  63. /***** Links *****/
  64. a,
  65. a:link,
  66. a:visited,
  67. a:hover {
  68. text-decoration:underline;
  69. }
  70. /***** Forms *****/
  71. form {
  72. margin:0;
  73. padding:0;
  74. display:inline;
  75. }
  76. input, select, textarea {
  77. font:1em Arial, Helvetica, sans-serif;
  78. }
  79. textarea {
  80. width:100%;
  81. line-height:1.25;
  82. }
  83. label {
  84. cursor:pointer;
  85. }
  86. /***** Tables *****/
  87. table {
  88. border:0;
  89. margin:0 0 1.25em 0;
  90. padding:0;
  91. }
  92. table tr td {
  93. padding:2px;
  94. }
  95. /***** Wrapper *****/
  96. #wrap {
  97. width:960px;
  98. margin:0 auto;
  99. }
  100. /***** Global Classes *****/
  101. .clear { clear:both; }
  102. .float-left { float:left; }
  103. .float-right { float:right; }
  104. .text-left { text-align:left; }
  105. .text-right { text-align:right; }
  106. .text-center { text-align:center; }
  107. .text-justify { text-align:justify; }
  108. .bold { font-weight:bold; }
  109. .italic { font-style:italic; }
  110. .underline { border-bottom:1px solid; }
  111. .highlight { background:#ffc; }
  112. .wrap { width:960px;margin:0 auto; }
  113. .img-left { float:left;margin:4px 10px 4px 0; }
  114. .img-right { float:right;margin:4px 0 4px 10px; }
  115. .nopadding { padding:0; }
  116. .noindent { margin-left:0;padding-left:0; }
  117. .nobullet { list-style:none;list-style-image:none; }

Sunday, May 24, 2009

A collection of Global CSS Resets

Reset Reloaded

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}

/* remember to define focus styles! */ :focus {
outline: 0;
}

body {
line-height: 1;
color: black;
background: white;
}

ol, ul {
list-style: none;
}

/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse:
separate; border-spacing: 0;
}

caption, th, td {
text-align: left;
font-weight: normal;
}

blockquote:before, blockquote:after, q:before, q:after {
content: "";
}

blockquote, q {
quotes: "" "";
}



A Killer Collection of Global CSS Reset Styles


Discussion on Global CSS Resets at Webmaster World

Wednesday, May 13, 2009

CSS CHEAT SHEET

SYNTAX
Syntax
selector {property: value;}
External Style Sheet
link rel="stylesheet" type="text/css" href="style.css"
Internal Style

Inline Style



GENERAL
Class String preceded by a period
ID String preceded by a hash mark
div Formats structure or block of text
span Inline formatting
color Foreground color
cursor Appearance of the cursor
display
block; inline; list-item; none
overflow How content overflowing its box is handled
visible, hidden, scroll, auto
visibility
visible, hidden
FONT
font-style
Italic, normal
font-variant
normal, small-caps
font-weight
bold, normal, lighter, bolder, integer (100-900)
font-size Size of the font
font-family Specific font(s) to be used
TEXT
letter-spacing Space between letters
line-height Vertical distance between baselines
text-align Horizontal alignment
text-decoration
blink, line-through, none, overline, underline
text-indent First line indentation
text-transform
capitalize, lowercase, uppercase
vertical-align Vertical alignment
word-spacing Spacing between words
BOX MODEL
CSS Box Model height; width; margin-top; margin-right; margin-bottom; margin-left; padding-top; padding-right; padding-bottom; padding-left;
BORDER
border-width Width of the border
border-style
dashed; dotted; double; groove; inset; outset; ridge; solid; none
border-color Color of the border
POSITION
clear Any floating elements around the element?
both, left, right, none
float Floats to a specified side
left, right, none
left The left position of an element
auto, length values (pt, in, cm, px)
top The top position of an element
auto, length values (pt, in, cm, px)
position
static, relative, absolute
z-index Element above or below overlapping elements?
auto, integer (higher numbers on top)
BACKGROUND
background-color Background color
background-image Background image
background-repeat
repeat, no-repeat, repeat-x, repeat-y
background-attachment Background image scroll with the element?
scroll, fixed
background-position
(x y), top, center, bottom, left, right
LIST
list-style-type Type of bullet or numbering in the list
disc; circle; square; decimal; lower-roman; upper-roman; lower-alpha; upper-alpha; none
list-style-position Position of the bullet or number in a list
inside; outside
list-style-image Image to be used as the bullet in a list

* The properties for each selector are in the order they should appear when using shorthand notation.

Shorthand*


background
border
border-bottom
border-left
border-right
border-top
font
list-style
margin
padding

Comments


/* Comment */

Pseudo Selectors


:hover
:active
:focus
:link
:visited
:first-line
:first-letter

Media Types


all
braille
embossed
handheld
print
projection
screen
speech
tty
tv

Units


Length %
em
pt
px
Keywords bolder
lighter
larger




Source
http://lesliefranke.com/files/reference/csscheatsheet.html