<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Lisa Wollin : CSS</title><link>http://blogs.msdn.com/lisawoll/archive/tags/CSS/default.aspx</link><description>Tags: CSS</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Creating a CSS File for your Web site</title><link>http://blogs.msdn.com/lisawoll/archive/2005/02/01/364734.aspx</link><pubDate>Tue, 01 Feb 2005 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:364734</guid><dc:creator>lisawoll</dc:creator><slash:comments>28</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/364734.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=364734</wfw:commentRss><description>&lt;p&gt;Dave Berry wrote an excellent article about Cascading Style Sheets (CSS) on MSDN (&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfp2k2/html/odc_fpusingcssonwebsite.asp" target="_blank"&gt;Using Cascading Style Sheets on Your Web Site&lt;/a&gt;), so I won't bore you with the details of CSS.&amp;nbsp; However, one reader commented that the article didn't cover how to create an external CSS file.&amp;nbsp; This is very easy, so here's how.&lt;/p&gt; &lt;p&gt;Say you have the following embedded style sheet on a page and you want to share the styles with other pages in your site. (See "Three Types of Cascading Style Sheets: External, Embedded, and Inline" in Dave's article.)&lt;/p&gt;&lt;pre&gt;&amp;lt;style&amp;gt;&lt;br /&gt;BODY&lt;br /&gt;{font-family: Comic Sans, Verdana, Tahoma, Arial;&lt;br /&gt;font-size: 10pt;&lt;br /&gt;margin: 0em;}&lt;br /&gt;&lt;br /&gt;P&lt;br /&gt;{padding-left: 5;&lt;br /&gt;padding-right: 5;}&lt;br /&gt;&lt;br /&gt;H1&lt;br /&gt;{font-size: 11pt;&lt;br /&gt;font-weight: bold;&lt;br /&gt;color: white;&lt;br /&gt;background: #FF3399;&lt;br /&gt;padding-top: 10;&lt;br /&gt;padding-bottom: 5;&lt;br /&gt;padding-left: 10;&lt;br /&gt;padding-right: 10;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;/pre&gt; &lt;p&gt;All you do is copy the contents of the STYLE element (the text between the tags but not the tags themselves) into a new file.&amp;nbsp; (In FrontPage 2003, you can create a new blank page, display the page in Code view, and paste the CSS code.&amp;nbsp; In earlier versions, you can either use HTML view or Notepad.)&amp;nbsp; Then save the file with a .CSS extension.&amp;nbsp; I usually call the main CSS file for a Web site web.css just for the sake of consistency, but you can name it anything you want.&lt;/p&gt; &lt;p&gt;The contents of your new file should look something like this:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;BODY&lt;br /&gt; {font-family: Comic Sans, Verdana, Tahoma, Arial;&lt;br /&gt; font-size: 10pt;&lt;br /&gt; margin: 0em;}&lt;br /&gt;&lt;br /&gt;P&lt;br /&gt; {padding-left: 5;&lt;br /&gt; padding-right: 5;}&lt;br /&gt;&lt;br /&gt;H1&lt;br /&gt; {font-size: 11pt;&lt;br /&gt; font-weight: bold;&lt;br /&gt; color: white;&lt;br /&gt; background: #FF3399;&lt;br /&gt; padding-top: 10;&lt;br /&gt; padding-bottom: 5;&lt;br /&gt; padding-left: 10;&lt;br /&gt; padding-right: 10;}&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Once you have the CSS file, you can remove the STYLE element and it's contents from the first page, and add a LINK element or an @Import statement.&amp;nbsp; I rarely have more than one CSS file for a Web site, so I generally use the LINK element (like the one shown below).&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;link rel="stylesheet" type="text/css" href="web.css"&amp;gt;&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;But if you anticipate using more than one CSS file in a Web site, you can use the @import statement, as shown in the following code:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt; @import url(web.css);&lt;br /&gt; @import url(page.css);&lt;br /&gt; &amp;lt;/style&amp;gt;&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Dave gives a great explanation of the difference between these two and what happens if two styles conflict with each other.&lt;/p&gt; &lt;p&gt;It really is that simple.&amp;nbsp; Deciding which styles to use is much more difficult.&amp;nbsp; I (personally) like the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/css_ref_entry.asp" target="_blank"&gt;CSS attribute reference&lt;/a&gt; list on MSDN, but keep in mind that some of the CSS attributes listed are IE only (like the scrollbar styles).&amp;nbsp; Plus, there are literally dozens of online CSS resources.&amp;nbsp; Here are just a few that I found through the new &lt;a href="http://www.msn.com/" target="_blank"&gt;MSN search&lt;/a&gt;.&amp;nbsp; Try your own search and find your own CSS resources.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.stylegala.com/features/css-reference/" target="_blank"&gt;Stylegala CSS Reference&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.javascriptkit.com/dhtmltutors/cssreference.shtml" target="_blank"&gt;javascriptkit.com CSS Reference&lt;/a&gt; &lt;li&gt;&lt;a href="http://builder.com.com/5100-31-5071268.html" target="_blank"&gt;builder.com CSS Reference Table&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=364734" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/CSS/default.aspx">CSS</category></item><item><title>Changing the appearance of the browser scrollbar</title><link>http://blogs.msdn.com/lisawoll/archive/2004/09/03/225452.aspx</link><pubDate>Fri, 03 Sep 2004 21:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:225452</guid><dc:creator>lisawoll</dc:creator><slash:comments>16</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/225452.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=225452</wfw:commentRss><description>&lt;p&gt;I wanted to call this tip "Why I love Internet Explorer" because you can only do this in Internet Explorer.&amp;nbsp; I would guess that most, if not all, hard-core Web developers know how to do this, but for any of you who don't and want to know, this tip's for you.&lt;/p&gt; &lt;p&gt;There may be some of you who will want to criticize this tip because it only shows up in Internet Explorer and not any other browser, but using the code provided here doesn't cause any script errors, and if you display a page that uses it in another browser, the browser will just ignore it, so no harm done.&lt;/p&gt; &lt;p&gt;When I first saw a page where the scrollbar was different, I thought, "cool, I want to know how to do that."&amp;nbsp; I found out that it was very simple.&amp;nbsp; All you need to do is use one or more of the following seven CSS attributes:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;scrollbar-3dlight-color&lt;br /&gt;scrollbar-highlight-color&lt;br /&gt;scrollbar-face-color&lt;br /&gt;scrollbar-shadow-color&lt;br /&gt;scrollbar-darkshadow-color&lt;br /&gt;scrollbar-base-color&lt;br /&gt;scrollbar-arrow-color&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;You can change the appearance of the scrollbar for the APPLET, BDO, BODY, DIV, EMBED, OBJECT, and TEXTAREA elements just by putting the CSS attributes into the &lt;b&gt;style&lt;/b&gt; attribute of the element, placing them within a STYLE element in the HEAD section of any page, or adding them to an external CSS file.&lt;/p&gt; &lt;blockquote&gt;&lt;b&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Some of the above elements only affect a portion of the page, for example the TEXTAREA element, and the appearance of the scrollbars will change only for that element and not the entire page.&amp;nbsp; To affect the browser window for the entire page, put the settings in the style for the BODY element. &lt;p&gt;Also, if you want to change the appearance of the scrollbars within an IFRAME element, you would need to put the CSS attributes within the page referenced in the &lt;b&gt;src&lt;/b&gt; attribute for the IFRAME element rather than in the page that contains the IFRAME element.&amp;nbsp; Setting the scrollbar attributes for the IFRAME itself has no effect.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Here's some simple code.&amp;nbsp; For more information on any of these CSS attributes, see the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/css_ref_entry.asp" target="_blank"&gt;CSS reference documentation&lt;/a&gt; on MSDN.&lt;/p&gt;&lt;pre&gt;&amp;lt;style&amp;gt;&lt;br /&gt;body{&lt;br /&gt; scrollbar-3dlight-color: red;&lt;br /&gt; scrollbar-highlight-color: blue;&lt;br /&gt; scrollbar-face-color: navy;&lt;br /&gt; scrollbar-shadow-color: black;&lt;br /&gt; scrollbar-darkshadow-color: yellow;&lt;br /&gt; scrollbar-base-color: green;&lt;br /&gt; scrollbar-arrow-color: aqua;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;/pre&gt; &lt;p&gt;Copy and paste this code into the HEAD section of any page, and then open the page in Internet Explorer.&amp;nbsp; Voila!&lt;/p&gt; &lt;p&gt;The following is an enlarged image of what the scrollbar looks like with these scrollbar settings.&amp;nbsp; I intentionally specified different colors for each of the CSS attributes in this example to make it easy for you to determine which attribute applies to the different parts of the scroll bar.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;img height="84" src="http://www.wollinweb.com/blogimages/scrollbar.gif" width="500" border="0" /&gt;&lt;/p&gt; &lt;p&gt;Please don't copy this code wholesale without changing it because this code creates a MUCHO ugly scrollbar, and I don't want to be indirectly responsible for any MUCHO ugly web sites.&amp;nbsp; However, with a little coordinating of the colors, you can create scrollbars that match the colors in your web site.&amp;nbsp; Very cool!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=225452" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/CSS/default.aspx">CSS</category></item></channel></rss>