Top Questions - SnippetGood most recent 30 from http://snippetgood.com 2010-03-12T00:49:28Z http://snippetgood.com/feeds http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://snippetgood.com/questions/151/how-do-i-make-two-column-layout-so-that-the-height-of-both-columns-is-100 How do I make two-column layout so that the height of both columns is 100%? Antti Sykäri 2009-11-12T03:28:54Z 2010-03-04T11:22:28Z <p>Assume that</p> <ul> <li>I want a two-column layout, say 200px wide navi and 400px wide content.</li> <li>Either column can have an arbitrary amount of text (so I can't assume that the content is always taller than the navigation, for example).</li> <li>I'd like both columns to have the same height, which is the maximum of the heights they would naturally have.</li> </ul> <p>There are <a href="http://www.pagecolumn.com/2%5Fcol%5Fgenerator.htm" rel="nofollow">lots of</a> <a href="http://www.456bereastreet.com/lab/developing%5Fwith%5Fweb%5Fstandards/csslayout/2-col/finished.html" rel="nofollow">2-column layout examples</a> on the web, but they either depend on the other column always being taller, or use tricks like <a href="http://css-tricks.com/examples/SuperSimpleTwoColumn/" rel="nofollow">colored background images</a> of fixed width.</p> <p>Are tables or javascript the only options?</p> http://snippetgood.com/questions/154/image-animation image animation RemusRigo 2009-11-24T10:47:42Z 2010-03-03T13:26:41Z <p>hi all I have a site <a href="http://rigo.ro" rel="nofollow">rigo.ro</a> witch displays two images and moves them around. Under Iternet explorer it works great, but I want a code that works under Opera/Firefox</p> <p>any help is welcomed thanks</p> http://snippetgood.com/questions/111/css-inline-embedded-external-or-external-parse CSS: inline, embedded, external or external parse Gwyneth 2009-10-19T16:21:35Z 2010-03-03T07:23:00Z <p>I was thinking about server load times and wondering what the most efficient way to add css is. What gets loaded fastest?</p> <p>For my part, I think the external css is the easiest to maintain as a project scales, but sometimes you need a lot of these stylesheets for large scale websites with a lot of varying sections. What about parsing several css sheets on load?</p> <p>as for snippets:</p> <p>inline:</p> <pre><code>&lt;div style="float: left;" class="left"&gt;hi&lt;/div&gt; </code></pre> <p>embedded:</p> <pre><code>&lt;head&gt; .left { float: left } &lt;/head&gt; &lt;body&gt; &lt;div class="left"&gt;hi&lt;/div&gt; &lt;/body&gt; </code></pre> <p>external:</p> <pre><code> &lt;head&gt; &lt;link rel="stylesheet" type="text/css" href="style.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="left"&gt;hi&lt;/div&gt; &lt;/body&gt; </code></pre> <p>parsing:</p> <pre><code> ???? </code></pre> http://snippetgood.com/questions/66/current-year-copyright-line-in-asp Current Year Copyright Line in ASP binky 2009-10-11T01:50:35Z 2010-02-28T10:23:07Z <p>I was wondering what ways there are to have the current year in a copyright line. I don't like having to change it manually every year.</p> http://snippetgood.com/questions/125/how-can-i-find-a-div-in-javascript-or-jquery How can I find a div in javascript or jquery Greg 2009-10-23T16:45:36Z 2010-02-26T23:22:57Z <p>How do I find on my page using javascript or jquery?</p> http://snippetgood.com/questions/33/how-do-you-make-rounded-corners-in-all-browsers How do you make rounded corners in all browsers? binky 2009-10-03T03:05:13Z 2010-02-20T06:31:57Z <p>CSS? JQuery? What's the best and most efficient way to make rounded corners that work in all browsers? I've tried a few and right now I'm making small divs that are positioned negatively outside of the relatively positioned parent divs. Instead of foreground images, I use sprites so the corner divs are less invasive. (ha ha I should give them shorter class names too)</p> <p>since I'm asking for a snippet - I'll leave a snippet of what I do. </p> <pre><code>&lt;div id="container"&gt; &lt;div class="corner-top-left"&gt;&lt;/div&gt;&lt;div class="corner-top-right"&gt;&lt;/div&gt; &lt;div class="corner-bottom-left"&gt;&lt;/div&gt;&lt;div class="corner-bottom-right"&gt;&lt;/div&gt; &lt;/div&gt; #container { display: block; height: 300px; position: relative; width: 500px; } .corner-top-left, .corner-top-right, .corner-bottom-left, .corner-bottom-right { background: url(corner.png) 0 0 no-repeat; display: block; height: 10px; position: absolute; width: 10px; } .corner-top-left { top: -10px; left: -10px;} .corner-top-right { background-position: x x; top: -10px; right: -10px;} .corner-bottom-left { background-position: x x; bottom: -10px; left: -10px;} .corner-bottom-right { background-position: x x; bottom: -10px; right: -10px;} </code></pre> http://snippetgood.com/questions/79/what-doctype-is-best-for-standards-and-cross-browser-compliance What doctype is best for standards and cross browser compliance? Snipper 2009-10-11T21:11:03Z 2010-02-19T18:32:51Z <p>Hello, I know there are a few different doctypes out there, but which is a good one to use and benefits associated with it?</p> <p>Thank you, Ronson</p> http://snippetgood.com/questions/159/apache-and-iis-compression Apache and IIS Compression Snipper 2010-02-01T01:58:06Z 2010-02-01T01:58:06Z <p>If you're wondering how you can do compression using apache and IIS 6 and 7 check out the this article</p> <p><a href="http://www.danvogler.com/articles/apache-iis-compression.html" rel="nofollow">www.danvogler.com</a></p> http://snippetgood.com/questions/158/what-is-the-shoemoney-system What is The ShoeMoney System? Snipper 2010-01-10T17:03:19Z 2010-01-10T17:03:19Z <p>The ShoeMoney System is one of our trusted sponsors. I've used the system personally, and many other techniques Jeremy Schoemaker has there's no doubt that this is the quickest way to advertise your site.</p> <p><a href="http://www.shoemoneysystem.com/its-coming/?c=dvogler1" rel="nofollow">http://www.shoemoneysystem.com/its-coming/?c=dvogler1</a></p> <p>Signup and you'll get four more videos. Watch them! It's a great intro to what internet marketing has to offer. If you think this offer is cheesy, it's not! </p> http://snippetgood.com/questions/157/looking-for-a-little-bit-of-js-that-will-randomly-choose-content looking for a little bit of js that will randomly choose content. julian-mann 2010-01-09T15:29:05Z 2010-01-09T15:29:05Z <p>I have a stackexchange site, vfxoverflow.com, and I would like yo place content in a box at random, or cycle through or whatever. For example, there are some tips or prompts such as: </p> <ul> <li>"Please vote up good questions"</li> <li>"Don't post answers as comments, make a new answer"</li> <li>"Don't post comments in the answer field"</li> </ul> <p>I would like to put one in the question banner - a different one each refresh.</p> <p>Thanks</p> <p>Julian</p> http://snippetgood.com/questions/63/current-year-copyright-line-in-jquery Current Year Copyright Line in JQuery binky 2009-10-11T01:44:54Z 2009-11-22T06:56:42Z <p>I was wondering what ways there are to have the current year in a copyright line. I don't like having to change it manually every year.</p> http://snippetgood.com/questions/149/tool-snippet-designer-for-visual-studio Tool: Snippet Designer for Visual Studio StopTheSearch.com 2009-11-11T21:30:49Z 2009-11-11T21:30:49Z <p>I just found a great tool on CodePlex - it simplifies all your snippet needs and can even take code you've highlighted in the IDE and covert it to a snippet auto-magically</p> <p><a href="http://www.codeplex.com/SnippetDesigner" rel="nofollow">http://www.codeplex.com/SnippetDesigner</a></p> http://snippetgood.com/questions/129/how-can-i-display-formatted-rss-data-in-a-div How can I display formatted rss data in a DIV OPIEWeb 2009-10-23T19:33:07Z 2009-11-11T13:25:24Z <p>I'd like to display the title and a snippet of the last 2 or 3 entries of an RSS feed on another site. </p> <p>I do not have access to a server-side technology on the receiving page, only Javascript/JQuery. </p> <p>What do I need in order to get that done? </p> http://snippetgood.com/questions/89/if-statements-and-ranges If statements and ranges miss snippet 2009-10-13T17:23:45Z 2009-11-11T04:45:33Z <p>I have a JQuery script that I'm working on and in part of it, I am comparing a value to make sure it is within a specific integer range.</p> <p>This is what my first attempt looks like:</p> <pre><code>if (levelCounter &lt; 0) { levelCounter = 0; } if (levelCounter &gt; maxLevels) { levelCounter = maxLevels;} </code></pre> <p>I'm hoping there's a shorter more efficient way to do this - I can't think of it off the top of my head.</p> http://snippetgood.com/questions/120/b-or-strong <b> or <strong>? Snipper 2009-10-23T03:15:54Z 2009-11-11T04:39:16Z <p>Let's talk html. Why am I told to use the <code>&lt;strong&gt;</code> tag instead of <code>&lt;b&gt;</code>? Was <code>&lt;b&gt;</code> too confusing?</p> http://snippetgood.com/questions/143/using-font-tags-in-html-and-css Using font tags in html and css. Tillimook 2009-10-31T16:05:30Z 2009-11-11T04:29:03Z <p>What's the best practice when using font tags in html? Should I keep that in the css or use font tags in html?</p> http://snippetgood.com/questions/100/community-server-siteurls-config-and-vanity community server SiteUrls.config and vanity Greg 2009-10-15T19:41:53Z 2009-11-04T20:57:46Z <p>How can I manipulate the vanity element in a url node? This is more of a general question, because I know I can get by with vanity={2}, but a lack of proper understanding is holding me back from truly mastering my community server site.</p> <p>I've seen examples like this in the SiteUrls.config: </p> <pre><code>&lt;url name="post_InPage_Old" path = "{0}/ShowThread.aspx#{1}" pattern = "(\d+)/ShowThread.aspx" vanity="{2}?PostID=$1^PermaPost=$2^UrlName=permalink" page="ForumUrlHandler.ashx" /&gt; </code></pre> <p>but the format confuses me. What are the $1 and $2? Where are they set?</p> http://snippetgood.com/questions/107/asp-net-conditional-statements ASP.NET Conditional Statements Tillimook 2009-10-17T15:52:33Z 2009-10-31T16:29:04Z <p>What kind of conditional statements does asp.net have, and how are they coded?</p> <p>I'd like to see both VB and C#.</p> <p>Here's a VB one I use:</p> <pre><code>If condition Then &lt;statements&gt; Else If condition Then &lt;statements&gt; </code></pre> <p>Thank you.</p> http://snippetgood.com/questions/142/how-can-i-detect-which-browser-a-visitor-is-using How can I detect which browser a visitor is using? Snipper 2009-10-31T15:45:38Z 2009-10-31T15:45:38Z <p>I want to show different content or give display a message to visitors using a specific browser.</p> <p>Using javascript (or maybe jquery) or .NET can I detect the browser?</p> http://snippetgood.com/questions/141/how-do-i-find-a-good-web-host-for-my-snippets How do I find a good web host for my snippets? Snipper 2009-10-29T18:23:44Z 2009-10-29T18:23:44Z <p>Alright, I'm not asking for a snippet, but this is a <strong><em>very</em></strong> important question.</p> <p><strong>How do I find and choose the right host for my website?</strong></p> <p>I want a host that has reliable systems and good customer service.</p> http://snippetgood.com/questions/140/a-calendar-for-your-website A calendar for your website? Snipper 2009-10-29T17:54:27Z 2009-10-29T17:54:27Z <p>I've got some events I woud like to organize in a calendar, and I don't want to spend a lot of time with complicated systems. I found an calendar made in tables. </p> <pre><code>&lt;TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3&gt; &lt;TR&gt; &lt;TD COLSPAN="7" ALIGN=center&gt;&lt;B&gt;December 2001&lt;/B&gt;&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD COLSPAN="7" ALIGN=center&gt;&lt;I&gt;Another year comes to an end&lt;/I&gt;&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD ALIGN=center&gt;Sun&lt;/TD&gt; &lt;TD ALIGN=center&gt;Mon&lt;/TD&gt; &lt;TD ALIGN=center&gt;Tue&lt;/TD&gt; &lt;TD ALIGN=center&gt;Wed&lt;/TD&gt; &lt;TD ALIGN=center&gt;Thu&lt;/TD&gt; &lt;TD ALIGN=center&gt;Fri&lt;/TD&gt; &lt;TD ALIGN=center&gt;Sat&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD ALIGN=center&gt;2&lt;/TD&gt; &lt;TD ALIGN=center&gt;3&lt;/TD&gt; &lt;TD ALIGN=center&gt;4&lt;/TD&gt; &lt;TD ALIGN=center&gt;5&lt;/TD&gt; &lt;TD ALIGN=center&gt;6&lt;/TD&gt; &lt;TD ALIGN=center&gt;7&lt;/TD&gt; &lt;TD ALIGN=center&gt;8&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD ALIGN=center&gt;9&lt;/TD&gt; &lt;TD ALIGN=center&gt;10&lt;/TD&gt; &lt;TD ALIGN=center&gt;11&lt;/TD&gt; &lt;TD ALIGN=center&gt;12&lt;/TD&gt; &lt;TD ALIGN=center&gt;13&lt;/TD&gt; &lt;TD ALIGN=center&gt;14&lt;/TD&gt; &lt;TD ALIGN=center&gt;15&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD ALIGN=center&gt;16&lt;/TD&gt; &lt;TD ALIGN=center&gt;17&lt;/TD&gt; &lt;TD ALIGN=center&gt;18&lt;/TD&gt; &lt;TD ALIGN=center&gt;19&lt;/TD&gt; &lt;TD ALIGN=center&gt;20&lt;/TD&gt; &lt;TD ALIGN=center&gt;21&lt;/TD&gt; &lt;TD ALIGN=center&gt;22&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD ALIGN=center&gt;23&lt;/TD&gt; &lt;TD ALIGN=center&gt;24&lt;/TD&gt; &lt;TD ALIGN=center&gt;25&lt;/TD&gt; &lt;TD ALIGN=center&gt;26&lt;/TD&gt; &lt;TD ALIGN=center&gt;27&lt;/TD&gt; &lt;TD ALIGN=center&gt;28&lt;/TD&gt; &lt;TD ALIGN=center&gt;29&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;TD ALIGN=center&gt;30&lt;/TD&gt; &lt;TD ALIGN=center&gt;31&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;TD ALIGN=center&gt;&lt;/TD&gt; &lt;/TR&gt; &lt;/TABLE&gt; </code></pre> <p>I would much prefer an asp or php coded app. Is there anything I can use?</p> http://snippetgood.com/questions/139/how-do-i-make-a-scaling-background-for-an-expandable-div How do I make a scaling background for an expandable div? Gwyneth 2009-10-29T17:53:53Z 2009-10-29T17:53:53Z <p>I have a div that I need to stretch a background for. It has a top and a bottom which shouldn't repeat, but the middle should. What's the best way to go about this? An image at the top and bottom and a div with a repeating background around them? </p> http://snippetgood.com/questions/136/how-do-i-do-url-rewriting-with-mvc How do I do URL rewriting with MVC? miss snippet 2009-10-28T16:24:08Z 2009-10-29T17:44:20Z <p>How do I do URL rewriting with MVC? Where do I put the code? Is it in Global.asax?</p> <p>Updated question: Can someone give me a snippet for defining routes in MVC?</p> http://snippetgood.com/questions/50/how-can-i-make-a-basic-jquery-rotator How can I make a basic jquery rotator? Greg 2009-10-08T22:57:42Z 2009-10-29T17:41:24Z <p>Are there any jquery rotators out there that are both basic and flexible? I've tried a bunch of carousel ones and they are not what I want.</p> <p>It should have pager ability and transitions if possible. Also I need to be able to put text on the images, but if that's not possible I could save the text into the images.</p> http://snippetgood.com/questions/37/how-do-i-reset-the-css-of-a-website How do I reset the CSS of a website? Tillimook 2009-10-04T03:37:45Z 2009-10-27T23:49:37Z <p>How can I reset the CSS of a website?</p> http://snippetgood.com/questions/29/what-are-the-best-internet-explorer-hacks-in-css What are the best Internet Explorer hacks in CSS Greg 2009-10-02T15:25:49Z 2009-10-26T22:09:15Z <p>Let's get to the bottom of this. Hacks are a neccessary evil sometimes, but they make my css look ugly and add bulk to my file.</p> <p>What is the best way to make things look right in all versions of internet explorer?</p> <p>I've seen a lot of this:</p> <pre><code>html&gt;body .class </code></pre> <p>some of this</p> <pre><code>voice-family: "\"}\""; voice-family:inherit; </code></pre> <p>And even this</p> <pre><code>height: 60px!important; height: 60px; </code></pre> http://snippetgood.com/questions/126/add-a-class-to-something-based-on-its-content-in-jquery add a class to something based on its content in jquery? Gwyneth 2009-10-23T16:49:08Z 2009-10-23T16:58:38Z <p>I have a bunch of divs that have the same class on them. They are created dynamically, so I can't assign any further classes to differentiate them. Is there anything I can do to make one have red text for example if it's a certain tag like "photoshop"?</p> http://snippetgood.com/questions/122/jquery-how-can-i-use-show-hide-and-opacity JQuery how can I use show/hide and opacity? miss snippet 2009-10-23T03:51:19Z 2009-10-23T03:51:19Z <p>This goes for all effects except for slideUp/slideDown. </p> <p>If I set opacity for an id/class that I'm manipulating with show/hide or fadeIn/fadeOut, my opacity is set to 1 (100%) instead of whatever I've set it as in the css. Is there any way to override that behaviour? </p> http://snippetgood.com/questions/119/wrap-text-around-image-with-html-and-css Wrap text around image with html and css. Snipper 2009-10-23T03:11:01Z 2009-10-23T03:16:29Z <p>How can I wrap text around an image? </p> <p>The image can be in the top left or right. </p> <p>I'm thinking of using a graphical image for a drop case letter, or a profile picture with text wrapping around it.</p> http://snippetgood.com/questions/42/use-jquery-hosted-by-google-or-hosted-by-microsoft Use jQuery hosted by Google or hosted by Microsoft? StopTheSearch.com 2009-10-05T04:50:02Z 2009-10-21T03:31:11Z <p>They both offer jQuery hosting now - which should I use? I'm leaning towards the Microsoft option since they also host the jquery-1.3.2-vsdoc.js file which means I get full Intellisense support in Visual Studio.</p> <p>Thoughts?</p>