<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>CSS on Lin's Blog</title><link>https://coder.tw/en/tags/css/</link><description>Recent content in CSS on Lin's Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Wed, 26 Apr 2017 09:54:28 +0000</lastBuildDate><atom:link href="https://coder.tw/en/tags/css/index.xml" rel="self" type="application/rss+xml"/><item><title>CSS Inner Border: Drawing a Border Inside the Box</title><link>https://coder.tw/en/posts/css-inner-border/</link><pubDate>Wed, 26 Apr 2017 09:54:28 +0000</pubDate><guid>https://coder.tw/en/posts/css-inner-border/</guid><description>&lt;p&gt;While designing my &lt;a href="http://me.coder.tw"&gt;personal landing page&lt;/a&gt;, I wanted to create an inner border effect, and I learned a clever technique for it. When it comes to a CSS inner border, your first instinct is probably to use padding or margin to make the box bigger. But that doesn&amp;rsquo;t work: when you enlarge the box, the border moves along with it, so you can&amp;rsquo;t create an inner border style this way.&lt;/p&gt;</description></item><item><title>Fixing HTML Anchor Content Hidden Behind a Menu</title><link>https://coder.tw/en/posts/fix-html-anchor-hidden-by-menu/</link><pubDate>Mon, 20 Feb 2017 23:28:39 +0000</pubDate><guid>https://coder.tw/en/posts/fix-html-anchor-hidden-by-menu/</guid><description>&lt;p&gt;HTML anchors are very handy. When a page is long, an anchor lets visitors jump quickly to a specific section. This technique shows up in many technical documents and blogs. If you&amp;rsquo;ve seen a URL like &lt;a href="https://coder.tw/?p=123#section1"&gt;https://coder.tw/?p=123#section1&lt;/a&gt;, that&amp;rsquo;s the HTML anchor feature at work. Although it&amp;rsquo;s convenient, it brings some problems. The most common one: there is a floating menu at the top of the page. When a visitor clicks an anchor link, the browser does scroll to the section, but part of the text ends up hidden behind the menu. I had always been annoyed by this, and today, while reading Facebook&amp;rsquo;s technical documentation, I found their solution, which is pretty good.&lt;/p&gt;</description></item><item><title>SASS Basics: Variables, Mixins, Extend, and Nesting</title><link>https://coder.tw/en/posts/sass-basic-tutorial-variables-nesting/</link><pubDate>Tue, 07 Feb 2012 23:14:55 +0000</pubDate><guid>https://coder.tw/en/posts/sass-basic-tutorial-variables-nesting/</guid><description>&lt;p&gt;In the previous article, &lt;a href="https://coder.tw/?p=859" target="_blank"&gt;&amp;ldquo;When CSS Meets Variables and Functions, It Becomes SASS: SASS Installation Tutorial&amp;rdquo;&lt;/a&gt;, I showed how to install SASS. In this article I&amp;rsquo;ll show you how to use SASS. It covers four of SASS&amp;rsquo;s main features: variables, mixins, extend, and nesting.&lt;/p&gt;</description></item><item><title>When CSS Meets Variables and Functions, It Becomes SASS: SASS Installation Tutorial</title><link>https://coder.tw/en/posts/sass-install-tutorial-variables-functions/</link><pubDate>Tue, 07 Feb 2012 21:31:00 +0000</pubDate><guid>https://coder.tw/en/posts/sass-install-tutorial-variables-functions/</guid><description>&lt;p&gt;Anyone who writes both programs and CSS has probably wished that CSS could have variables and functions, the things programming languages have. Many CSS rules are repetitive, and if CSS had variables and functions, writing it would be a lot faster. Generally, that kind of dream seems impossible&amp;hellip; But today I&amp;rsquo;ll introduce a new toy called SASS. With SASS, CSS can become something very different~&lt;/p&gt;</description></item><item><title>Zen Coding: A Great Tool for Speedy Web Development, a Must-Have for Anyone Who Likes Hand-Writing Web Pages～</title><link>https://coder.tw/en/posts/zen-coding-fast-web-development/</link><pubDate>Mon, 22 Aug 2011 21:40:44 +0000</pubDate><guid>https://coder.tw/en/posts/zen-coding-fast-web-development/</guid><description>&lt;p&gt;I think many people are like me: when building a web page, they don&amp;rsquo;t like dragging out the layout directly in DW, and instead prefer to open Notepad and write the HTML by hand～ The upside of this approach is that it sharpens your skills XD, but the downside is that development is a bit slow (actually, once you get used to working this way, you&amp;rsquo;re faster than you would be with DW&amp;hellip; XD). Today I want to introduce Zen Coding to you — it can make you write web pages N times faster! You can write web pages directly using CSS-style syntax～&lt;/p&gt;</description></item><item><title>[CSS 3] Tilt Images and Web Pages with transform: rotate</title><link>https://coder.tw/en/posts/css3-transform-rotate/</link><pubDate>Sat, 23 Apr 2011 09:22:08 +0000</pubDate><guid>https://coder.tw/en/posts/css3-transform-rotate/</guid><description>&lt;p&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/04/2011-04-23_085636.jpg"&gt;&lt;img class="size-large wp-image-422 aligncenter" title="2011-04-23_085636" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/04/2011-04-23_085636-540x386.jpg" alt="" width="540" height="386" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A while ago, the news reported that if you searched for the Chinese word &amp;ldquo;傾斜&amp;rdquo; (meaning &amp;ldquo;tilt&amp;rdquo;) on the mobile version of Google, the results page would lean to the right. This effect isn&amp;rsquo;t hard to make at all. It only takes one line of CSS, because it is one of the CSS 3 standards. For now, IE browsers don&amp;rsquo;t support this CSS 3 tilt syntax (including IE 9). Also, it isn&amp;rsquo;t really one line: each browser has its own syntax, so you have to write several lines. Hopefully this will improve in the future.&lt;/p&gt;</description></item><item><title>[CSS 3] Give Your Website Rounded Corners with Pure CSS!</title><link>https://coder.tw/en/posts/css3-border-radius/</link><pubDate>Sat, 16 Apr 2011 11:32:53 +0000</pubDate><guid>https://coder.tw/en/posts/css3-border-radius/</guid><description>&lt;p&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/04/2011-04-16_111212.jpg"&gt;&lt;img class="size-large wp-image-395 aligncenter" title="2011-04-16_111212" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/04/2011-04-16_111212-540x314.jpg" alt="" width="540" height="314" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Back in the CSS 2 days, giving images or div elements rounded corners was quite a hassle. The simple option was to use a function that someone had already written in jQuery. If you preferred to do it yourself, you had to design rounded-corner images and overlay them on each other. In short, it was very complicated. But in CSS 3 you no longer need such cumbersome tricks. You can just set it directly in your CSS!&lt;/p&gt;</description></item><item><title>How to Detect IE and Apply the Matching Code? (The If IE Technique)</title><link>https://coder.tw/en/posts/detect-ie-browser-if-ie-technique/</link><pubDate>Mon, 28 Feb 2011 13:54:10 +0000</pubDate><guid>https://coder.tw/en/posts/detect-ie-browser-if-ie-technique/</guid><description>&lt;p&gt;If you are a web designer, the thing you hate most when designing pages is browser compatibility. Every browser supports CSS and JavaScript differently. Your CSS might look perfectly fine in Chrome, but show different results in Firefox. This happens most often with IE, because IE has the weakest support for CSS and JavaScript. Other browsers might just look a little different, while in IE the effect may not show up at all&amp;hellip; So this article shows you how to apply specific code or CSS only to IE, or only to non-IE browsers.&lt;/p&gt;</description></item><item><title>W3C Validation: Checking Whether Your Site's CSS Meets the Standards</title><link>https://coder.tw/en/posts/w3c-css-validation/</link><pubDate>Sun, 06 Sep 2009 13:36:56 +0000</pubDate><guid>https://coder.tw/en/posts/w3c-css-validation/</guid><description>&lt;p&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2009/09/2009-09-06-000.jpg"&gt;&lt;img class="alignnone size-full wp-image-1873" title="2009-09-06 000" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2009/09/2009-09-06-000.jpg" alt="2009-09-06 000" width="405" height="84" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;About the W3C:&lt;/h2&gt;
The W3C is an organization dedicated to standardizing the web. It is responsible for drafting all kinds of web-related specifications. For example, the CSS4 standard and XHTML were both created by the W3C. Why create these standards? The reason is simple. Web pages are displayed in different browsers. If every browser used different syntax, web designers would have a hard time. But getting all browser vendors to agree on one standard is difficult. I think the main reason is that they're all competing with each other. That's why the W3C was created: an impartial third party drafts the standards, and each browser vendor (such as IE, Opera, and Firefox) must follow these basic rules. Of course, browsers can add their own syntax if they want. Still, not every browser follows the W3C specifications. Big names like IE don't, which is why many web designers have a love-hate relationship with IE (love, because so many people use it; hate, because it doesn't play by the rules). Now that you have a basic understanding of the W3C, let me show you how to check whether a web page meets the standards.</description></item><item><title>[CSS] Setting the Maximum Width and Height of Images</title><link>https://coder.tw/en/posts/set-max-image-size/</link><pubDate>Fri, 15 May 2009 21:00:17 +0000</pubDate><guid>https://coder.tw/en/posts/set-max-image-size/</guid><description>&lt;p&gt;You can use a CSS rule to set the maximum width and height of an image.&lt;/p&gt;
&lt;pre lang="css"&gt;Maximum width:
tag-name img{
max-width:width-value
}
Maximum height:
tag-name img{
max-height:height-value
}
&lt;/pre&gt;
&lt;p&gt;Also, the height (width) value can be expressed as a percentage.&lt;/p&gt;
&lt;p&gt;These rules help keep your blog&amp;rsquo;s images from overflowing their area.&lt;/p&gt;
&lt;p&gt;However, this rule doesn&amp;rsquo;t work in IE6.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m still researching how to make it work in IE too.&lt;/p&gt;
&lt;p&gt;It probably requires JavaScript.&lt;/p&gt;</description></item></channel></rss>