{"id":276,"date":"2008-04-03T17:40:47","date_gmt":"2008-04-03T22:40:47","guid":{"rendered":"http:\/\/www.opticality.com\/blog\/?p=276"},"modified":"2008-04-03T17:40:47","modified_gmt":"2008-04-03T22:40:47","slug":"css-hack-added","status":"publish","type":"post","link":"https:\/\/opticality.com\/blog\/2008\/04\/03\/css-hack-added\/","title":{"rendered":"CSS Hack Added"},"content":{"rendered":"<p>When I upgraded to WordPress 2.5 <a title=\"Welcome WordPress 2.5\" href=\"https:\/\/www.opticality.com\/blog\/2008\/03\/30\/welcome-wordpress-25\/\" target=\"_self\">I articulated a few UI problems<\/a> on my site. Here&#8217;s the relevant section:<\/p>\n<blockquote>\n<ol>\n<li>The Sociable plugin is once again formatting the bullets in a block list, rather than inline. This can be fixed with my own css (as I\u2019ve done in the past), but I have no idea what broke in the upgrade\u2026<\/li>\n<li>TinyMCE (in WP2.5) won\u2019t allow me to display the link editor (AJAX form). It comes up blank. I am posting this from IE until I figure that out. Not cool, but also not stuck\u2026<\/li>\n<li>This ordered list is not showing the numbers in IE7, but is in Firefox. \ud83d\ude41<\/li>\n<\/ol>\n<\/blockquote>\n<p><a rel=\"tag\" class=\"hashtag u-tag u-category\" href=\"https:\/\/opticality.com\/blog\/tag\/1\/\">#1<\/a> above turned out to be simple. There was a checkbox that I needed to set in the Sociable options to apply the sociable.css file. This was either a new option that I didn&#8217;t need to set before upgrading both the plugin and WordPress, or something in the upgrade to WordPress coupled with a deactivate\/activate of the plugin caused that setting to be lost.<\/p>\n<p><a rel=\"tag\" class=\"hashtag u-tag u-category\" href=\"https:\/\/opticality.com\/blog\/tag\/2\/\">#2<\/a> auto-corrected itself. I&#8217;ll guess that the next time I restarted Firefox it just worked, and I panicked prematurely.<\/p>\n<p>#3 was the real thorny problem, and is the subject of this post.<\/p>\n<p>It&#8217;s likely that this bug existed for a few weeks before I upgraded to WordPress 2.5. Most certainly, it is not related in any way to WordPress at all (any version).<\/p>\n<p>When I installed the SandPress theme (based on the Sandbox Theme Template) which is linked in the footer of every page on this site (unless you&#8217;re reading this in the future, and I&#8217;ve changed my theme again) \ud83d\ude09 I decided to tweak it (which was a CSS change only).<\/p>\n<p>One of the things that I did was <strong>remove<\/strong> the attribute &#8220;list-style-position:inside&#8221;. I <strong>hate<\/strong> the fact that ordered lists that span multiple lines have text under the number. It not only looks bad (IMHO) it makes it less readable. By removing the &#8220;inside&#8221;, I got the default of &#8220;outside&#8221; (without specifying it), and I immediately tested in Firefox (my default browser), and it worked correctly, and I was <em>done<\/em>.<\/p>\n<p>When I upgraded to WordPress 2.5 I did it on my laptop first. I just happened to test in IE first, and noticed that I have no numbers on any ordered list. I tried a number of things but couldn&#8217;t get it to work. I thought that it was something related to the WP 2.5 upgrade, so I needed to decide whether I&#8217;d just <em>live with it<\/em> temporarily, or back off the upgrade. I decided to live with it.<\/p>\n<p>It altered my behavior. In a recent post, I really wanted an ordered list, but I hated the look in IE without the numbers, so reluctantly turned it into a bulleted list. \ud83d\ude41<\/p>\n<p>Earlier this week I finally took some time to track it down. That included installing an IE development addon which does what the Firefox DOM Inspector does. I had assumed that in IE, the problem was the &#8220;list-style-type&#8221; wasn&#8217;t being set to <strong>decimal<\/strong>. I was wrong. It was correctly set to decimal! I was truly stumped. I tried a number of other things, and then gave up.<\/p>\n<p>Today, it occurred to me that there&#8217;s no way that the original SandPress theme was broken this badly. So, I switched (on my laptop) to the untweaked SandPress theme, and voila, IE showed ordered lists with numbers. Good. Now I did a diff on the original style.css file with my tweaked version. The difference was obvious, namely the inclusion in the original file of the attribute &#8220;list-style-position:inside&#8221;, which I had removed.<\/p>\n<p>So, it appears that the designer of SandPress knew that IE7 couldn&#8217;t correctly render &#8220;list-style-position:outside&#8221; (whether explicitly set, or defaulted). So, he threw up his hands and set it to inside, and lived with it. I totally understand that decision, but for me, I wouldn&#8217;t be happy with seeing it this way in Firefox.<\/p>\n<p>So, I did a quick search and found <a title=\"CSS Hacks\" href=\"http:\/\/tanreisoftware.com\/blog\/?p=39\" target=\"_blank\">this blog<\/a> showing a variety of CSS hacks. Here&#8217;s the relevant section on <strong>targeting IE7<\/strong>:<\/p>\n<blockquote><p>Target Internet Explorer 7:<br \/>\n[className=&#8221;actualClassName&#8221;] { &#8230; }<\/p><\/blockquote>\n<p>In case you aren&#8217;t familiar, you can either <strong>target<\/strong> or <strong>filter<\/strong> specific browsers. Targeting means that the rest of the line will only apply to that particular browser. Filtering means that the rest of the line will <strong>not<\/strong> apply to the specific browser.<\/p>\n<p>In this case, I wanted the default to be <strong>outside<\/strong> for all browsers, but for IE7 to be <em>inside<\/em>. That meant targeting IE7 with the inside clause.<\/p>\n<p>It worked perfectly. Now, ordered lists look like I want them to in Firefox, and look poor (to me) in IE7, but at least have numbers. Whew.<\/p>\n<p>Back in business. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I upgraded to WordPress 2.5 I articulated a few UI problems on my site. Here&#8217;s the relevant section: The Sociable plugin is once again formatting the bullets in a block list, rather than inline. This can be fixed with my own css (as I\u2019ve done in the past), but I have no idea what [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[4,3,2],"tags":[23,235,21],"class_list":["post-276","post","type-post","status-publish","format-standard","hentry","category-4","category-3","category-2","tag-blog-software","tag-computers","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/posts\/276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/comments?post=276"}],"version-history":[{"count":0,"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/posts\/276\/revisions"}],"wp:attachment":[{"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/media?parent=276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/categories?post=276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opticality.com\/blog\/wp-json\/wp\/v2\/tags?post=276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}