<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: css code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 21:24:47 GMT</pubDate>
    <description>DZone Snippets: css code</description>
    <item>
      <title>Need to center the content div</title>
      <link>http://snippets.dzone.com/posts/show/5667</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;br /&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"&gt;&lt;br /&gt;	&lt;style type="text/css"&gt;&lt;br /&gt;	body {&lt;br /&gt;		margin-left: 0px;&lt;br /&gt;		margin-top: 0px;&lt;br /&gt;		margin-right: 0px;&lt;br /&gt;		margin-bottom: 0px;&lt;br /&gt;		background-color:#8E908F;&lt;br /&gt;		&lt;!--background-image:url(images/repeatingBackground.jpg);&lt;br /&gt;		background-repeat:repeat-x;--&gt;&lt;br /&gt;		text-align: center;&lt;br /&gt;	}&lt;br /&gt;	div#content {&lt;br /&gt;		position: relative;&lt;br /&gt;		margin:0 auto;&lt;br /&gt;		display:block;&lt;br /&gt;		width:1024px;&lt;br /&gt;		background-color:#8E908F;&lt;br /&gt;		text-align:center;&lt;br /&gt;	}&lt;br /&gt;	&lt;/style&gt;&lt;br /&gt;	&lt;head&gt;&lt;br /&gt;		&lt;title&gt;Classroom&lt;/title&gt;&lt;br /&gt;		&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;&lt;br /&gt;		&lt;script type="text/javascript" src="js/swfobject.js"&gt;&lt;/script&gt;&lt;br /&gt;		&lt;script type="text/javascript"&gt;&lt;br /&gt;		swfobject.embedSWF("media/Main.swf", "content", "1024", "576", "9.0.0", "media/expressInstall.swf", {},{allowfullscreen: "true", base: "media"}, {});&lt;br /&gt;		&lt;/script&gt;&lt;br /&gt;	&lt;/head&gt;&lt;br /&gt;	&lt;body&gt;&lt;br /&gt;		&lt;div id="content"&gt;&lt;br /&gt;			&lt;p&gt;&lt;a href="http://www.adobe.com/go/getflashplayer"&gt;&lt;img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;		&lt;/div&gt;&lt;br /&gt;	&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 18 Jun 2008 19:52:09 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5667</guid>
      <author>dropthezero (Jonathan)</author>
    </item>
    <item>
      <title>Use the current filename as the HTML body id</title>
      <link>http://snippets.dzone.com/posts/show/5635</link>
      <description>// Makes the body id = the current filename - extension&lt;br /&gt;// Useful while working on static markup that relies on styles/scripts targeting the current page &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;	$page = $_SERVER['PHP_SELF'];&lt;br /&gt;	$page = str_replace("/","",$page);&lt;br /&gt;	$page = str_replace(".php","",$page);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;body id="&lt;?php echo $page ?&gt;"&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 11 Jun 2008 19:05:36 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5635</guid>
      <author>milkshake (milkshake)</author>
    </item>
    <item>
      <title>Fix PNG transparent IE6</title>
      <link>http://snippets.dzone.com/posts/show/5566</link>
      <description>&lt;code&gt;&lt;br /&gt;function fixPNG() {&lt;br /&gt;	if(navigator.appName == 'Microsoft Internet Explorer') {&lt;br /&gt;		var png = /\.png$/i;&lt;br /&gt;		var imgs = document.getElementsByTagName('img');&lt;br /&gt;		for(var i = 0, l = imgs.length; i &lt; l; i++) {&lt;br /&gt;			if(png.test(imgs.item(i).src)) {&lt;br /&gt;				imgs.item(i).style.width = imgs.item(i).offsetWidth;&lt;br /&gt;				imgs.item(i).style.height = imgs.item(i).offsetHeight;&lt;br /&gt;				imgs.item(i).style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgs.item(i).src + '\',sizingMethod=\'image\')';&lt;br /&gt;				imgs.item(i).src = 'empty.gif';&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ab-d.fr"&gt;Retour &#224; la source : &lt;/a&gt;&lt;a href="http://www.ab-d.fr/date/2008-06-01/"&gt;PNG transparent 24 bits for Internet Explorer 6&lt;/a&gt;</description>
      <pubDate>Sun, 01 Jun 2008 07:22:55 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5566</guid>
      <author>ki4ngel (Benoit Asselin)</author>
    </item>
    <item>
      <title>Image Rotate with CANVAS</title>
      <link>http://snippets.dzone.com/posts/show/5514</link>
      <description>&lt;code&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;	&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;&lt;br /&gt;	&lt;title&gt;rotate()&lt;/title&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;style type="text/css" media="screen"&gt;&lt;br /&gt;	img, canvas { border: 1px solid black; }&lt;br /&gt;	&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;&lt;br /&gt;function rotate(p_deg) {&lt;br /&gt;	if(document.getElementById('canvas')) {&lt;br /&gt;		/*&lt;br /&gt;		Ok!: Firefox 2, Safari 3, Opera 9.5b2&lt;br /&gt;		No: Opera 9.27&lt;br /&gt;		*/&lt;br /&gt;		var image = document.getElementById('image');&lt;br /&gt;		var canvas = document.getElementById('canvas');&lt;br /&gt;		var canvasContext = canvas.getContext('2d');&lt;br /&gt;		&lt;br /&gt;		switch(p_deg) {&lt;br /&gt;			default :&lt;br /&gt;			case 0 :&lt;br /&gt;				canvas.setAttribute('width', image.width);&lt;br /&gt;				canvas.setAttribute('height', image.height);&lt;br /&gt;				canvasContext.rotate(p_deg * Math.PI / 180);&lt;br /&gt;				canvasContext.drawImage(image, 0, 0);&lt;br /&gt;				break;&lt;br /&gt;			case 90 :&lt;br /&gt;				canvas.setAttribute('width', image.height);&lt;br /&gt;				canvas.setAttribute('height', image.width);&lt;br /&gt;				canvasContext.rotate(p_deg * Math.PI / 180);&lt;br /&gt;				canvasContext.drawImage(image, 0, -image.height);&lt;br /&gt;				break;&lt;br /&gt;			case 180 :&lt;br /&gt;				canvas.setAttribute('width', image.width);&lt;br /&gt;				canvas.setAttribute('height', image.height);&lt;br /&gt;				canvasContext.rotate(p_deg * Math.PI / 180);&lt;br /&gt;				canvasContext.drawImage(image, -image.width, -image.height);&lt;br /&gt;				break;&lt;br /&gt;			case 270 :&lt;br /&gt;			case -90 :&lt;br /&gt;				canvas.setAttribute('width', image.height);&lt;br /&gt;				canvas.setAttribute('height', image.width);&lt;br /&gt;				canvasContext.rotate(p_deg * Math.PI / 180);&lt;br /&gt;				canvasContext.drawImage(image, -image.width, 0);&lt;br /&gt;				break;&lt;br /&gt;		};&lt;br /&gt;		&lt;br /&gt;	} else {&lt;br /&gt;		/*&lt;br /&gt;		Ok!: MSIE 6 et 7&lt;br /&gt;		*/&lt;br /&gt;		var image = document.getElementById('image');&lt;br /&gt;		switch(p_deg) {&lt;br /&gt;			default :&lt;br /&gt;			case 0 :&lt;br /&gt;				image.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=0)';&lt;br /&gt;				break;&lt;br /&gt;			case 90 :&lt;br /&gt;				image.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=1)';&lt;br /&gt;				break;&lt;br /&gt;			case 180 :&lt;br /&gt;				image.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=2)';&lt;br /&gt;				break;&lt;br /&gt;			case 270 :&lt;br /&gt;			case -90 :&lt;br /&gt;				image.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=3)';&lt;br /&gt;				break;&lt;br /&gt;		};&lt;br /&gt;		&lt;br /&gt;	};&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;window.onload = function() {&lt;br /&gt;	var image = document.getElementById('image');&lt;br /&gt;	var canvas = document.getElementById('canvas');&lt;br /&gt;	if(canvas.getContext) {&lt;br /&gt;		image.style.visibility = 'hidden';&lt;br /&gt;		image.style.position = 'absolute';&lt;br /&gt;	} else {&lt;br /&gt;		canvas.parentNode.removeChild(canvas);&lt;br /&gt;	};&lt;br /&gt;	&lt;br /&gt;	rotate(0);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;	rotate:&lt;br /&gt;	&lt;input type="button" value="0&#176;" onclick="rotate(0);" /&gt;&lt;br /&gt;	&lt;input type="button" value="90&#176;" onclick="rotate(90);" /&gt;&lt;br /&gt;	&lt;input type="button" value="180&#176;" onclick="rotate(180);" /&gt;&lt;br /&gt;	&lt;input type="button" value="-90&#176;" onclick="rotate(-90);" /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;	&lt;img id="image" src="http://www.google.com/intl/en_ALL/images/logo.gif" alt="" /&gt;&lt;br /&gt;	&lt;canvas id="canvas"&gt;&lt;/canvas&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ab-d.fr"&gt;Source: AB-D.fr&lt;/a&gt; - &lt;a href="http://www.ab-d.fr/date/2008-05-18/"&gt;Effectuer une rotation d'image en CSS ( rotate balise canvas HTML5 )&lt;/a&gt;</description>
      <pubDate>Sun, 18 May 2008 15:22:51 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5514</guid>
      <author>ki4ngel (Benoit Asselin)</author>
    </item>
    <item>
      <title>Floating 2 column layout</title>
      <link>http://snippets.dzone.com/posts/show/5500</link>
      <description>Basic CSS with global clear&lt;br /&gt;&lt;code&gt;&lt;br /&gt;html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, &lt;br /&gt;p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, &lt;br /&gt;dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, &lt;br /&gt;sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, &lt;br /&gt;table, caption, tbody, tfoot, thead, tr, th, td {&lt;br /&gt;    margin: 0;&lt;br /&gt;    padding: 0;&lt;br /&gt;    border: 0;&lt;br /&gt;    outline: 0;&lt;br /&gt;    font-weight: inherit;&lt;br /&gt;    font-style: inherit;&lt;br /&gt;    font-size: 100%;&lt;br /&gt;    font-family: inherit;&lt;br /&gt;    vertical-align: baseline;&lt;br /&gt;    background: transparent;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;:focus {&lt;br /&gt;    outline: 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div#wrapper{&lt;br /&gt;	width:800px;&lt;br /&gt;	margin:0px auto;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div#header{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div#left{&lt;br /&gt;	float:left;&lt;br /&gt;	width:380px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div#right{&lt;br /&gt;	float:right;&lt;br /&gt;	width:380px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div#footer{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.clear{&lt;br /&gt;	clear:both;&lt;br /&gt;}	&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;HTML&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;br /&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;&lt;br /&gt;&lt;title&gt;&lt;/title&gt;&lt;br /&gt;&lt;%= stylesheet_link_tag "application" %&gt;&lt;br /&gt;&lt;link href="application.css" rel="stylesheet" type="text/css" /&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;div id="wrapper"&gt;&lt;br /&gt;	&lt;div id="header"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;/div&gt;&lt;br /&gt;	&lt;div id="left"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;/div&gt;&lt;br /&gt;	&lt;div id="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;/div&gt;&lt;br /&gt;	&lt;div class="clear"&gt;&lt;/div&gt;&lt;br /&gt;	&lt;div id="footer"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 16 May 2008 03:56:37 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5500</guid>
      <author>adevstar (Nick)</author>
    </item>
    <item>
      <title>Giving form labels a width</title>
      <link>http://snippets.dzone.com/posts/show/5422</link>
      <description>For some reason this has always bugged me in the past. When using a label they don't comply with width unless accompanied by a float. I've used em to define the width so that is conforms with browser text settings. Dead simple&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;label {&lt;br /&gt;	margin-right:10px;&lt;br /&gt;	width:10em;&lt;br /&gt;	float:left;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 22 Apr 2008 10:52:08 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5422</guid>
      <author>Booma (Alan Coleman)</author>
    </item>
    <item>
      <title>Adding style to SVG</title>
      <link>http://snippets.dzone.com/posts/show/5392</link>
      <description>To reference a CSS file within an SVG file refer to the following example code.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?xml-stylesheet href="styles_austria_1.css" type="text/css"?&gt; &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Here's what an SVG CSS file looks like.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;.str1 {stroke:#0093DD;stroke-width:16;color:#0093DD}&lt;br /&gt;.str2 {stroke:#0093DD;stroke-width:12}&lt;br /&gt;.str3 {stroke:#0093DD;stroke-width:10}&lt;br /&gt;.str4 {stroke:#0093DD;stroke-width:6}&lt;br /&gt;&lt;br /&gt;.str0 {stroke:#DA251D;stroke-width:55;color:#DA251D}&lt;br /&gt;.str6 {stroke:#BB90BB;stroke-width:44;color:#BB90BB}&lt;br /&gt;.str5 {stroke:#0093DD;stroke-width:4}&lt;br /&gt;.str7 {stroke:#1F1A17;stroke-width:13}&lt;br /&gt;&lt;br /&gt;.fil0 {fill:none}&lt;br /&gt;.fil2 {fill:#1F1A17}&lt;br /&gt;.fil1 {fill:#C4E5FA}&lt;br /&gt;.fil3 {fill:#FFFFFF}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Source: &lt;a href="http://www.carto.net/papers/svg/samples/styles.shtml"&gt;Example for using CSS-Styles&lt;/a&gt; [carto.net]&lt;br /&gt;Reference: &lt;a href="http://www.w3.org/TR/SVG/styling.html#StylingWithCSS"&gt;Styling - SVG 1.1 - 20030114&lt;/a&gt; [w3.org]</description>
      <pubDate>Fri, 18 Apr 2008 21:37:11 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5392</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Cursor styles used in CSS</title>
      <link>http://snippets.dzone.com/posts/show/5329</link>
      <description>Source: &lt;a href="http://www.javascriptkit.com/dhtmltutors/csscursors.shtml"&gt;Custom CSS Cursors&lt;/a&gt; [javascriptkit.com]&lt;br /&gt;&lt;code&gt;&lt;br /&gt;cursor: default;&lt;br /&gt;cursor: hand;&lt;br /&gt;cursor: pointer;&lt;br /&gt;cursor: pointer; cursor: hand;&lt;br /&gt;cursor: crosshair;&lt;br /&gt;cursor: text;&lt;br /&gt;cursor: wait;&lt;br /&gt;cursor: help;&lt;br /&gt;cursor: move;&lt;br /&gt;cursor: e-resize;&lt;br /&gt;cursor: ne-resize;&lt;br /&gt;cursor: nw-resize;&lt;br /&gt;cursor: n-resize;&lt;br /&gt;cursor: se-resize;&lt;br /&gt;cursor: sw-resize;&lt;br /&gt;cursor: s-resize;&lt;br /&gt;cursor: w-resize;&lt;br /&gt;cursor: progress;&lt;br /&gt;cursor: all-scroll;&lt;br /&gt;cursor: col-resize;&lt;br /&gt;cursor: no-drop;&lt;br /&gt;cursor: not-allowed;&lt;br /&gt;cursor: row-resize;&lt;br /&gt;cursor: url(mycursor.cur); /* Note: Only .cur and .ani file types are supported as of IE6. */&lt;br /&gt;cursor: vertical-text;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 06 Apr 2008 23:37:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5329</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Force scrollbar with CSS</title>
      <link>http://snippets.dzone.com/posts/show/5327</link>
      <description>// Force Scrollbar&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;html {overflow: scroll}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 06 Apr 2008 21:11:26 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5327</guid>
      <author>t0b1 (T.B.)</author>
    </item>
    <item>
      <title>CSS *true* centering</title>
      <link>http://snippets.dzone.com/posts/show/5252</link>
      <description>This will truely center something in CSS. Not tested in IE, knowing IE, it will burn in flames.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#center-me { /* There can be only one Centerlander! */&lt;br /&gt;  height: 100%;&lt;br /&gt;  display: table !important;&lt;br /&gt;  margin: auto;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#center-me &gt; * {&lt;br /&gt;  display: table-cell !important; /* Don't touch me! I MEAN IT! DON- ... don't touch me. Really, don't touch me. */&lt;br /&gt;  vertical-align: middle !important;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;div id="center-me"&gt;&lt;br /&gt;  &lt;h1&gt;I'm centered!&lt;/h1&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Wed, 19 Mar 2008 07:30:22 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5252</guid>
      <author>elliottcable (elliott cable)</author>
    </item>
  </channel>
</rss>
