Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Wednesday, December 24, 2008

TortoiseSVN Checkout URL

If you've got a whole lot of SVN repositories that you access but don't have the Einstein-like brain to remember the location of all of them, you ought to create a webpage on your I.T. intranet portal with the location of all the repositories that you work with. If you use TortoiseSVN as your SVN client, you can turn the locations into hyperlinks that users can click on by adding a "tsvn:" as a prefix to the location in the HREF attribute.

Example:
I have an SVN repository located at http://nitinwritescode/svn/RedInk so the HTML that I write up looks like this:
<html>
<head>
<title>SVN Repositories</title>
</head>
<body>
<h1>SVN Repositories</h1>

<ul>
<li>
<a href="tsvn:http://nitinwritescode/svn/RedInk">Click here</a>
</li>
</ul>

</body>
</html>

When I click the link, I get the following dialog box from TortoiseSVN

Tuesday, December 23, 2008

Minify Your Web Page

If you're optimizing the performance of your website, you should try minifying your Javascript. What I mean is get rid of all the comments, line breaks and other whitespace. You will find a significant difference in the file size for larger Javascript files. Using JsMin can automate the minification of your Javascript but you really ought to read the documentation that they provide before using it. Get JsMin here - you can get both the .EXE executable and the source code.

You might want to try server-side compression configuration so the web server can compress the content before sending it to the browser. Caching is also something you can optimize to work in your favor.

PS: The Google home page is heavily minified - they even use short variable names!

Forcing IE 7 Compatibility in Internet Explorer 8

If your website doesn't display correctly in Microsoft Internet Explorer 8 but works fine in the IE-7 Compatibility mode, you can force the browser to automatically render your pages in IE-7 Compatibility mode by simply adding the META tag:
<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ />

Microsoft plans to address the compatibility issues with Internet Explorer 8 by building a community-driven list of websites that require the browser to render in IE-7 Compatibility mode so the users would not have to manually switch from the native IE-8 rendering mode - the browser would retrieve a fresh copy of the list periodically through updates.

Monday, December 1, 2008

Web Content Accessibility Guidelines (WCAG)

The World Wide Web was built with the objective of delivering content to all users, across heterogeneous systems and platforms. The idea worked for the most part, but we still have issues with the way browsers work - some sites require the use of a specific browser and, at times, developers create different versions of the pages for different web browsers. To help remedy the situation, the World Wide Web Consortium (W3C) came up with the Web Content Accessibility Guidelines (WCAG).

The WCAG 1.0 standard was published in May 1999. A draft version of WCAG 2.0 was created in January 2001, and the proposed version was formed in November 2008. WCAG 2.0 is expected to be published as a standard on 3rd December, 2008.

You can access the proposed WCAG 2.0 here. Also useful is the CSS techniques for the proposed WCAG 2.0 here.

Monday, July 28, 2008

Whitespaces and Display:None Tags

Normally, if you've got multiple occurrences of a whitespace in HTML, it gets converted to a single whitespace. However, if you add a couple of HTML tags with the CSS attribute display set to none, the spaces in the HTML document increase.

I find the behavior a bit odd, considering that the display: none isn't supposed to effect the layout of items, or so we would like to believe.

Saturday, May 31, 2008

Table-less forms

Often, web designers create (X)HTML forms using tables. Tables tend to clutter up the code when used excessively and ought to be replaced with DIVs coupled with some CSS.

A common issue with creating forms is that the label of the input element varies in width and therefore does not play nicely with respect to alignment (...which is the reason why most people resort to tables). The solution to this problem is to set a width for the label tag. Setting a normal width CSS attribute will not work because a label tag is, by default, an in-line display tag so you have to override the display property with a value of block or set the float property (Set the float property! You'll probably prefer this over setting the display property.).

If you set a uniform width for all form labels, you'll notice that all your input elements are left-aligned. For controls that do not have any label text, you would still probably want to place an empty label tag to get the left-alignment.

Anyway, more from me later. Happy web designing!

PS: For more info, see http://old.macedition.com/cb/testers/icabcss1.html

Friday, May 23, 2008

Divs or Tables

It has often been suggested that we use divs for layout of items instead of tables in HTML. Normally, the divs would be fine but when it comes to setting the background for the 'columns' created by divs, you would realise that the divs aren't the same size. This is due to the fact that, unlike table cells, divs do not change their height to match horizontally neighbouring divs. The workaround to the issue involves creating a wrapper div and setting the background color in the wrapper and setting a transparent background for the actual column. This creates just as much clutter as a table so everyone in the web design and development world hope CSS3 changes things for the better.