<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HUBBERS DOT COM BLOG &#187; css</title>
	<atom:link href="http://www.hubbers.com/index.php/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hubbers.com</link>
	<description>Sports, cycling, travel, scams, triathlons and other blogworthy events in my life</description>
	<lastBuildDate>Sat, 12 Nov 2011 14:56:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Converting CSS Properties into JavaScript</title>
		<link>http://www.hubbers.com/index.php/css-properties-to-javascript-reference-conversion/</link>
		<comments>http://www.hubbers.com/index.php/css-properties-to-javascript-reference-conversion/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 13:28:28 +0000</pubDate>
		<dc:creator>hubbers</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.hubbers.com/blog/?p=380</guid>
		<description><![CDATA[There are other examples of this out there on the web but I cna never find one when I need it so have added it to my blog for easy access. CSS Property JavaScript Reference background background background-attachment backgroundAttachment background-color backgroundColor background-image backgroundImage background-position backgroundPosition background-repeat backgroundRepeat border border border-bottom borderBottom border-bottom-color borderBottomColor border-bottom-style borderBottomStyle [...]]]></description>
			<content:encoded><![CDATA[<p>There are other examples of this out there on the web but I cna never find one when I need it so have added it to my blog for easy access. </p>
<table class="dataTable">
<tr>
<th>CSS Property </th>
<th>JavaScript Reference </th>
</tr>
<tr>
<td>background</td>
<td>background</td>
</tr>
<tr>
<td>background-attachment</td>
<td>backgroundAttachment</td>
</tr>
<tr>
<td>background-color</td>
<td>backgroundColor</td>
</tr>
<tr>
<td>background-image</td>
<td>backgroundImage</td>
</tr>
<tr>
<td>background-position</td>
<td>backgroundPosition</td>
</tr>
<tr>
<td>background-repeat</td>
<td>backgroundRepeat</td>
</tr>
<tr>
<td>border</td>
<td>border</td>
</tr>
<tr>
<td>border-bottom</td>
<td>borderBottom</td>
</tr>
<tr>
<td>border-bottom-color</td>
<td>borderBottomColor</td>
</tr>
<tr>
<td>border-bottom-style</td>
<td>borderBottomStyle</td>
</tr>
<tr>
<td>border-bottom-width</td>
<td>borderBottomWidth</td>
</tr>
<tr>
<td>border-color</td>
<td>borderColor</td>
</tr>
<tr>
<td>border-left</td>
<td>borderLeft</td>
</tr>
<tr>
<td>border-left-color</td>
<td>borderLeftColor</td>
</tr>
<tr>
<td>border-left-style</td>
<td>borderLeftStyle</td>
</tr>
<tr>
<td>border-left-width</td>
<td>borderLeftWidth</td>
</tr>
<tr>
<td>border-right</td>
<td>borderRight</td>
</tr>
<tr>
<td>border-right-color</td>
<td>borderRightColor</td>
</tr>
<tr>
<td>border-right-style</td>
<td>borderRightStyle</td>
</tr>
<tr>
<td>border-right-width</td>
<td>borderRightWidth</td>
</tr>
<tr>
<td>border-style</td>
<td>borderStyle</td>
</tr>
<tr>
<td>border-top</td>
<td>borderTop</td>
</tr>
<tr>
<td>border-top-color</td>
<td>borderTopColor</td>
</tr>
<tr>
<td>border-top-style</td>
<td>borderTopStyle</td>
</tr>
<tr>
<td>border-top-width</td>
<td>borderTopWidth</td>
</tr>
<tr>
<td>border-width</td>
<td>borderWidth</td>
</tr>
<tr>
<td>clear</td>
<td>clear</td>
</tr>
<tr>
<td>clip</td>
<td>clip</td>
</tr>
<tr>
<td>color</td>
<td>color</td>
</tr>
<tr>
<td>cursor</td>
<td>cursor</td>
</tr>
<tr>
<td>display</td>
<td>display</td>
</tr>
<tr>
<td>filter</td>
<td>filter</td>
</tr>
<tr>
<td>font</td>
<td>font</td>
</tr>
<tr>
<td>font-family</td>
<td>fontFamily</td>
</tr>
<tr>
<td>font-size</td>
<td>fontSize</td>
</tr>
<tr>
<td>font-variant</td>
<td>fontVariant</td>
</tr>
<tr>
<td>font-weight</td>
<td>fontWeight</td>
</tr>
<tr>
<td>height</td>
<td>height</td>
</tr>
<tr>
<td>left</td>
<td>left</td>
</tr>
<tr>
<td>letter-spacing</td>
<td>letterSpacing</td>
</tr>
<tr>
<td>line-height</td>
<td>lineHeight</td>
</tr>
<tr>
<td>list-style</td>
<td>listStyle</td>
</tr>
<tr>
<td>list-style-image</td>
<td>listStyleImage</td>
</tr>
<tr>
<td>list-style-position</td>
<td>listStylePosition</td>
</tr>
<tr>
<td>list-style-type</td>
<td>listStyleType</td>
</tr>
<tr>
<td>margin</td>
<td>margin</td>
</tr>
<tr>
<td>margin-bottom</td>
<td>marginBottom</td>
</tr>
<tr>
<td>margin-left</td>
<td>marginLeft</td>
</tr>
<tr>
<td>margin-right</td>
<td>marginRight</td>
</tr>
<tr>
<td>margin-top</td>
<td>marginTop</td>
</tr>
<tr>
<td>overflow</td>
<td>overflow</td>
</tr>
<tr>
<td>padding</td>
<td>padding</td>
</tr>
<tr>
<td>padding-bottom</td>
<td>paddingBottom</td>
</tr>
<tr>
<td>padding-left</td>
<td>paddingLeft</td>
</tr>
<tr>
<td>padding-right</td>
<td>paddingRight</td>
</tr>
<tr>
<td>padding-top</td>
<td>paddingTop</td>
</tr>
<tr>
<td>page-break-after</td>
<td>pageBreakAfter</td>
</tr>
<tr>
<td>page-break-before</td>
<td>pageBreakBefore</td>
</tr>
<tr>
<td>position</td>
<td>position</td>
</tr>
<tr>
<td>float</td>
<td>styleFloat</td>
</tr>
<tr>
<td>text-align</td>
<td>textAlign</td>
</tr>
<tr>
<td>text-decoration</td>
<td>textDecoration</td>
</tr>
<tr>
<td>text-decoration: blink</td>
<td>textDecorationBlink</td>
</tr>
<tr>
<td>text-decoration: line-through</td>
<td>textDecorationLineThrough</td>
</tr>
<tr>
<td>text-decoration: none</td>
<td>textDecorationNone</td>
</tr>
<tr>
<td>text-decoration: overline</td>
<td>textDecorationOverline</td>
</tr>
<tr>
<td>text-decoration: underline</td>
<td>textDecorationUnderline</td>
</tr>
<tr>
<td>text-indent</td>
<td>textIndent</td>
</tr>
<tr>
<td>text-transform</td>
<td>textTransform</td>
</tr>
<tr>
<td>top</td>
<td>top</td>
</tr>
<tr>
<td>vertical-align</td>
<td>verticalAlign</td>
</tr>
<tr>
<td>visibility</td>
<td>visibility</td>
</tr>
<tr>
<td>width</td>
<td>width</td>
</tr>
<tr>
<td>z-index</td>
<td>zIndex</td>
</tr>
</table>
<h3>Usage</h3>
<p>Targeting elements by getElementById seems pretty universal.</p>
<p><code>document.getElementById('x').style.backgroundPosition = '0 -200px';</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hubbers.com/index.php/css-properties-to-javascript-reference-conversion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Converting px into percentage and em for relative CSS font sizes</title>
		<link>http://www.hubbers.com/index.php/converting-px-into-percentage-and-em-for-relative-css-font-sizes/</link>
		<comments>http://www.hubbers.com/index.php/converting-px-into-percentage-and-em-for-relative-css-font-sizes/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 17:31:49 +0000</pubDate>
		<dc:creator>hubbers</dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://www.hubbers.com/blog/?p=356</guid>
		<description><![CDATA[Recently I have started to get a lot of requests to make certain fonts on my websites this pixel (px) size or that pixel size. For accessibility reasons I do not use pixels as a measurement of font size. Pixels are what is known in the trades as a fixed font size so they do [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have started to get a lot of requests to make certain fonts on my websites this pixel (px) size or that pixel size.</p>
<p>For accessibility reasons I do not use pixels as a measurement of font size. Pixels are what is known in the trades as a fixed font size so they do not resize on some browsers when the user manually changes their browsers font size. The main problem is IE6 which despite all logical sense is an insanely widely used web browser.</p>
<p>So if a visitor to a poorly coded website had difficulty reading small text and they tried to increase the font size in IE6 and a lesser web developer had set the font sizes in pixels, then that user would not be able to read the web page. You could say that page would be inaccessible to them.</p>
<p>Thankfully there are some font size declarations that do resize in all the different web browsers. So if a user prefers to play online games such as <a href="http://ro.partypoker.com/">partypoker</a> using Firefox, but writes and sends emails via Google Chrome (with it&#8217;s useful ability to automatically spellcheck), then this won&#8217;t matter at all. Whatever they choose to access my site will still allow them to increase the font size to meet their own personal preferences. These are percentage (%) and em (em). I prefer percentages because that is what I started using way back in the day and they still haven&#8217;t let me down. But both effectively do the same thing.</p>
<p>Thankfully there are some font size declarations that do resize in all the different web browsers. These are percentage (%) and em (em). I prefer percentages because that is what I started using way back in the day and they still haven&#8217;t let me down. But both effectively do the same thing.</p>
<p>To make my life easy I made the following table to convert fixed pixel sizes into % and em. The maths is quite simple. <span style="background-color: #ffc">The basic font size on most browsers is 16px which is 100% or 1em</span>. To work out the percentage of 17px I divided 17 by 16 and multiplied by 100. The result is 106%. For em I just divided 17 by 16.</p>
<p>The other thing to note is that web browsers do not display non integer font sizes. So a percent of 105 might display at 17px or 16px depending on the browser.</p>
<p>One final point I should add is that every time you decrease the font size by 1px a certain number of users will no longer read the text. For that reason <span style="background-color:#fcf"">I do not like to use font sizes under 12px/75%/.75em</span>.</p>
<table border="0">
<tbody>
<tr>
<th>Px Size</th>
<th>% Size</th>
<th>Em Size</th>
</tr>
<tr>
<td style="font-size: 36px">36px</td>
<td style="font-size: 225%">225%</td>
<td style="font-size: 2.25em">2.25em</td>
</tr>
<tr>
<td style="font-size: 35px">35px</td>
<td style="font-size: 219%">219%</td>
<td style="font-size: 2.19em">2.19em</td>
</tr>
<tr>
<td style="font-size: 34px">34px</td>
<td style="font-size: 213%">213%</td>
<td style="font-size: 2.13em">2.13em</td>
</tr>
<tr>
<td style="font-size: 33px">33px</td>
<td style="font-size: 206%">206%</td>
<td style="font-size: 2.06em">2.06em</td>
</tr>
<tr>
<td style="font-size: 32px">32px</td>
<td style="font-size: 200%">200%</td>
<td style="font-size: 2em">2em</td>
</tr>
<tr>
<td style="font-size: 31px">31px</td>
<td style="font-size: 194%">194%</td>
<td style="font-size: 1.94em">1.94em</td>
</tr>
<tr>
<td style="font-size: 30px">30px</td>
<td style="font-size: 188%">188%</td>
<td style="font-size: 1.88em">1.88em</td>
</tr>
<tr>
<td style="font-size: 29px">29px</td>
<td style="font-size: 181%">1.81%</td>
<td style="font-size: 1.81em">1.81em</td>
</tr>
<tr>
<td style="font-size: 28px">28px</td>
<td style="font-size: 175%">175%</td>
<td style="font-size: 1.75em">1.75em</td>
</tr>
<tr>
<td style="font-size: 27px">27px</td>
<td style="font-size: 169%">169%</td>
<td style="font-size: 1.69em">1.69em</td>
</tr>
<tr>
<td style="font-size: 26px">26px</td>
<td style="font-size: 163%">163%</td>
<td style="font-size: 1.63em">1.63em</td>
</tr>
<tr>
<td style="font-size: 25px">25px</td>
<td style="font-size: 150%">156%</td>
<td style="font-size: 1.5em">1.5em</td>
</tr>
<tr>
<td style="font-size: 24px">24px</td>
<td style="font-size: 150%">150%</td>
<td style="font-size: 1.5em">1.5em</td>
</tr>
<tr>
<td style="font-size: 23px">23px</td>
<td style="font-size: 144%">144%</td>
<td style="font-size: 1.44em">1.44em</td>
</tr>
<tr>
<td style="font-size: 22px">22px</td>
<td style="font-size: 138%">138%</td>
<td style="font-size: 1.38em">1.38em</td>
</tr>
<tr>
<td style="font-size: 21px">21px</td>
<td style="font-size: 131%">131%</td>
<td style="font-size: 1.31em">1.31em</td>
</tr>
<tr>
<td style="font-size: 20px">20px</td>
<td style="font-size: 125%">125%</td>
<td style="font-size: 1.25em">1.25em</td>
</tr>
<tr>
<td style="font-size: 19px">19px</td>
<td style="font-size: 119%">119%</td>
<td style="font-size: 1.19em">1.19em</td>
</tr>
<tr>
<td style="font-size: 18px">18px</td>
<td style="font-size: 113%">113%</td>
<td style="font-size: 1.13em">1.13em</td>
</tr>
<tr>
<td style="font-size: 17px">17px</td>
<td style="font-size: 106%">106%</td>
<td style="font-size: 1.06em">1.06em</td>
</tr>
<tr>
<td style="font-size: 16px; background-color: #ffffcc">16px</td>
<td style="font-size: 100%; background-color: #ffffcc">100%</td>
<td style="font-size: 1em; background-color: #ffffcc">1em</td>
</tr>
<tr>
<td style="font-size: 15px">15px</td>
<td style="font-size: 94%">94%</td>
<td style="font-size: 0.94em">.94em</td>
</tr>
<tr>
<td style="font-size: 14px">14px</td>
<td style="font-size: 88%">88%</td>
<td style="font-size: 0.88em">.88em</td>
</tr>
<tr>
<td style="font-size: 13px">13px</td>
<td style="font-size: 81%">81%</td>
<td style="font-size: 0.81em">.81em</td>
</tr>
<tr>
<td style="font-size: 12px; background-color: #ffccff">12px</td>
<td style="font-size: 75%; background-color: #ffccff">75%</td>
<td style="font-size: 0.75em; background-color: #ffccff">.75em</td>
</tr>
<tr>
<td style="font-size: 11px">11px</td>
<td style="font-size: 69%">69%</td>
<td style="font-size: 0.69em">.69em</td>
</tr>
<tr>
<td style="font-size: 10px">10px</td>
<td style="font-size: 63%">63%</td>
<td style="font-size: 0.63em">.63em</td>
</tr>
<tr>
<td style="font-size: 9px">9px</td>
<td style="font-size: 56%">56%</td>
<td style="font-size: 0.56em">.56em</td>
</tr>
<tr>
<td style="font-size: 8px">8px</td>
<td style="font-size: 50%">50%</td>
<td style="font-size: 0.5em">.50em</td>
</tr>
</tbody>
</table>
<p>Note: there might be some subtle differences on less popular browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hubbers.com/index.php/converting-px-into-percentage-and-em-for-relative-css-font-sizes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

