<?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>My Quick Fix &#187; CSS</title>
	<atom:link href="http://myquickfix.co.uk/category/computers/web-development/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://myquickfix.co.uk</link>
	<description>Quick fixes for little problems...</description>
	<lastBuildDate>Thu, 16 Feb 2012 14:57:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Set space between list item and bullet (HTML, CSS)…</title>
		<link>http://myquickfix.co.uk/2009/06/set-space-between-list-item-and-bullet-html-css%e2%80%a6/</link>
		<comments>http://myquickfix.co.uk/2009/06/set-space-between-list-item-and-bullet-html-css%e2%80%a6/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 19:02:10 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=10</guid>
		<description><![CDATA[Problem I’ve just had to convert a Photoshop visual to a WordPress template. The designer wanted a bulleted list where the bullets themselves were very close to the list items, and were small dashes. Cross browser support for list item and bullet styling is ropey at best, and to make things perfect I’d have to [...]]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>I’ve just had to convert a Photoshop visual to a WordPress template. The designer wanted a bulleted list where the bullets themselves were very close to the list items, and were small dashes. Cross browser support for list item and bullet styling is ropey at best, and to make things perfect I’d have to resort to browser specific styles.</p>
<h2>Solution</h2>
<p>The solution I think I’ll be using for the rest of my ‘web’ career will be this. JUST FORGET THE BULLET ITEM, and use positioned background images instead.</p>
<p>In the stylesheet, add styles for both the ‘ul’ tag, and the ‘li’ tag like so (explanations inline):</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Set the indenting back to far left. */</span>
<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Set the indenting back to far left. */</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul li <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Switch the list bullet off altogether. */</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">dashbullet.gif</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* The replacement bullet image */</span>
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Place bullet 0px from left and 4px from top */</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span><span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Stops bullet tiling, important */</span>
<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* separation from li txt and bullet */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Then just create the list as you usually would, with ‘ul’ and ‘li’ tags. Here’s what it looks like in use:</p>
<p><a href="http://myquickfix.co.uk/wp-content/uploads/2011/09/list-fix.gif"><img class="alignnone size-full wp-image-11" title="Bullet fix in CSS" src="http://myquickfix.co.uk/wp-content/uploads/2011/09/list-fix.gif" alt="Bullet fix in CSS" width="200" height="150" /></a></p>
<p>Here’s a bit more detail so you can get your head around the spacing. It’s incredibly simple, but still, nice to have a diagram or two sometimes:</p>
<div id="attachment_12" class="wp-caption alignnone" style="width: 410px"><a href="http://myquickfix.co.uk/wp-content/uploads/2011/09/list-fix-detail.gif"><img class="size-full wp-image-12" title="list-fix-detail" src="http://myquickfix.co.uk/wp-content/uploads/2011/09/list-fix-detail.gif" alt="Detail showing some dimensions and spacing" width="400" height="174" /></a><p class="wp-caption-text">Detail showing some dimensions and spacing</p></div>
<p>This style works perfectly (by my testing, but I’m not perfect) on:</p>
<ul>
<li>Internet Explorer 6, 7 &amp; 8+</li>
<li>Firefox 2.*+</li>
<li>Opera 9+ (not tested 8, but bet it works!</li>
<li>Google Chrome (all versions)</li>
<li>Safari (Mac and PC versions)</li>
</ul>
<div>Any problems, please post a question or comment below.</div>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2009/06/set-space-between-list-item-and-bullet-html-css%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centre and float a div over page content with CSS – no hacks, cross browser</title>
		<link>http://myquickfix.co.uk/2008/12/centre-and-float-a-div-over-page-content-with-css-%e2%80%93-no-hacks-cross-browser/</link>
		<comments>http://myquickfix.co.uk/2008/12/centre-and-float-a-div-over-page-content-with-css-%e2%80%93-no-hacks-cross-browser/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 17:27:17 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=19</guid>
		<description><![CDATA[Problem If you need to center a div (or any another block element) over the rest of the content in a page, and you need it to be cross-browser and valid (CSS and XHTML)… Solution Try the following CSS in your stylesheet or page head: #cdiv &#123; position:absolute; /* important. */ left:50%; /*important if you [...]]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>If you need to center a div (or any another block element) over the rest of the content in a page, and you need it to be cross-browser and valid (CSS and XHTML)…</p>
<h2>Solution</h2>
<p>Try the following CSS in your stylesheet or page head:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#cdiv</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* important. */</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">50%</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*important if you want it absolutely centred in window. */</span> 
  <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-50px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* importnant. must be half the width. */</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* set to your requirements, but remember left margin setting. */</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* not neccessary if the element needs to grow with content. */</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ABF</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* not important. */</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#DDF</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* not important. */</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*not important. */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>… and now set the ID of the element you want centered to ‘cdiv’. If the item you want to centre is an image, remember to add display:block; to the style (this makes it act like a block level element).</p>
<p>This style works perfectly (by my testing, but I’m not perfect) on:</p>
<ul>
<li>Internet Explorer 6, 7 &amp; 8+</li>
<li>Firefox 2.*+</li>
<li>Opera 8 &amp; 9+</li>
<li>Google Chrome (all versions)</li>
<li>Safari (Mac and PC versions)</li>
<li>Netscape 9 (is anyone still using this?)</li>
</ul>
<div>Any problems, please post a question or comment below.</div>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2008/12/centre-and-float-a-div-over-page-content-with-css-%e2%80%93-no-hacks-cross-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

