Html & CSS

52framework: Html5 and CSS3 framework

52Framework is a HTML5 and CSS3 framework which aims to build websites using HTML5 & CSS3 easily.
This framework fully uses all the great advantages of HTML5 & CSS3 which makes much cleaner mark up.

52Framework

Features

  • Rounded corners
  • Text-shadow
  • Box-shadow
  • Html5 markup
  • Grid system
  • CSS reset
  • and much more…
Html & CSS

Cross browser CSS3 rule generator

CSS3, please! is a online cross-browser CSS3 rule generator. Which provides you to produce CSS3 properties by editing default properties. You can see the results of your inline changes in real time in a preview box. You can also able to toggle rules on and off to see how your design is looks like.
Using tool you can write rules for rounded boxes, border-radius, box-shadow, linear-gradients, rotation & @font-face.

CSS3 Generator is similar to CSS3, please!. It also explains each CSS3 value and shows the browser requirements of every rule.
Using tool you can write rules for Border Radius, Box Shadow, Text Shadow, @Font Face, Multiple Columns, Outline, Gradients.

Articles, Html & CSS, JQuery

Best Resources and tutorials for future web designs

1. Take Your Design To The Next Level With CSS3

In this article, we’ll look at the advantages of CSS3 and some examples of how Web designers are already using it. By the end, we’ll know a bit of what to expect from CSS3 and how we can use its new features in our projects… Read


http://www.smashingmagazine.com/2009/06/15/take-your-design-to-the-next-level-with-css3

2. CSS3 Exciting Functions and Features: 30+ Useful Tutorials

In this post we will take a look at some interesting properties of CSS3 that you can put into practice in your website designs today.
Read

3. A Collection of HTML5 Resources and Tutorials

By now everyone has heard of HTML 5 and its new functionalities. Pretty exciting isn’t it… also a little daunting. Of course, there are two sides to the excitement, most developers love it, others feel it has come to soon and we are not ready for it. … Read

speckyboy.com

4. 33 Must Read CSS3 Tips, Tricks, Tutorial Sites and Articles

Since previous article about CSS text effects got really big attention I decided to research and find more interesting articles and websites just focused on CSS3, teaching you how to use it, showing pros and cons and much more. Read

5. 22 Photoshop Web Design Interface Tutorial Sites

Article provides good resources for Photoshop Web Design Interface sites…Read

6. 35 Websites To Teach You How To Use CSS Effectively

In this article, you’ll have all the best resources available Read

7. jQuery UI

jQuery UI provides a comprehensive set of core interaction plugins, UI widgets and visual effects that use a jQuery-style, event-driven architecture and a focus on web standards, accessibility, flexible styling, and user-friendly design. Visit

8. 55 Jquery Tutorials, Resources, Tips And Tricks: Ultimate Collection

jQuery definitely is one of the biggest trends coming in up-to-date designs and the best of all, everything is done without countless code lines. Keeping in mind such aspects I created hopefully pretty complete collection of jQuery sites, tip and trick articles, video screencasts, tutorials, cheat sheets and lot’s more. Took a while to compile and research was really solid. Read

Html & CSS

CSS Sprites

Sprite is nothing but one image which has collection of small images that are required in web application. Which improves page loading time by reducing number of requests to server.

Why sprites

Consider one scenario , suppose we have two web pages,
1. first page shows 100 small images 1kb each
2. second page shows 1 big image of 100kb

What do you think , which page will get loaded first?
Now you may think that both pages will take same time as both pages has same page size (i.e. 100kb each), right??
Then your are wrong, second page will load first as compared to first page.

Because to fetch each resource, browser sends a HTTP-Request to server. that means to fetch 100 images browser needs to send 100 HTTP-Requests to server. Which increases page loading time so decreases performance of site.

CSS sprites reduce HTTP requests and the loading time of pages.
This is the main reason why CSS sprites are often used on websites with heavy
traffic.Particularly sprites are used for navigation (such as for hover effects), icons and buttons.

How to Use

Step 1. Creating sprite
To create sprite we can use any software like Photoshop, paint or fireworks etc.
Combine all images, icons into single images , keep some space (min. 1px ) between images as below,
sprite

Step 2. Creating CSS

Create common CSS class which applies background image to elements, As

ul#menu li a
        {
            background-image: url(sprite.gif);
        }

Now here comes the best part. To show particular image for class, we have to set
background-position correctly.
for that we have to make every image inside the sprite move to the top left corner (0px in X, 0px in Y) as that is the point where image start seeing.

To see about image button,
sprite1

ul#menu li a.about
        {
            background-position: -143px -4px;
        }

Step 3. Creating HTML

<ul id="menu">
<li><a href="#" class="home">Home</a></li>
<li><a href="#" class="about">About</a></li>
</ul>

Html & CSS

CSS Shorthand Guide

In my previous post, “CSS Formatter and Optimiser” I have given basic idea about CleanCSS Optimiser tool and how it does CSS optimization. CSS Shorthand is one of the important notations of CSS property which helps a lot to get optimized CSS.
So, I have collected some of important CSS shorthand properties here.

Margin and Padding

Margin and Padding both has same shorthand syntax.

.className{
  margin-top: 10px;
  margin-right: 5px;
  margin-bottom: 3px;
  margin-left: 1px;
}

Instead of above we can simply combined into

.className{
  margin: 10px 5px 3px 1px;
}

Value of margin property is in Top, Right, Bottom and Left.
Here are some images for quick reference of shorthand notations,

margin

Background

Refer following image for shorthand syntax,
background

Background Default Values
By default, the background property will assume the following when you do not declare each value of the properties,

backgrounddefault

Border

Refer following image for shorthand syntax,
border

Border has 3 px width by defaults, following CSS will create a ‘3px’ solid blue border

 .className{border:solid blue;}

Border examples

1. Following CSS will create 5px solid ‘black’ border

p {
  border:5px solid;
}

2. Following CSS will create a ‘3px’ dashed ‘black’ border

p {
  border:dashed;
}

3. Following CSS will create a 3px dotted red border

p {
  border:dotted;
  color:red;
}

4. Following CSS will create a 5px solid blue border

body {
  color:blue;
}
body p {
  border:5px solid;
}

Font

Refer following image for shorthand syntax,
font

Font Default values

fontdefault

Font examples

.className {
font-style:normal;
font-variant:normal;
font-weight:bold;
font-size:1em;
line-height:1.2em;
font-family:georgia,”times new roman”,serif;
}

can be combined as,

.className {
  font:bold 1em/1.2em georgia,"times new roman",serif;
}
Html & CSS

CSS Hacks

In this post we’ll see how to apply browser specific CSS using CSS hacks.

Why

As we know that Each browser has its own default styling of HTML elements also
some of the CSS properties are supports only limited number of browsers.

So to remove default styling we can use either reset CSS which will applied to all browsers or we can use CSS hacks for particular browser.

How to use

1. Internet Explorer

Using Conditional comments we can easily target IE.Conditional comments only works in Internet Explorer.
e.g. for IE 8 ,

<!--[if IE 8]><style type="text/css"> selector {property:value} </style><![endif]-->

The selector is HTML element/tag name or can be css class name,
property is the css attribute and value indicates attribute value.

Conditional comments are also applicable in page body,
e.g

<body>
<!--[if IE 8]>
 This is Internet Explorer 8<br />
<![endif]-->
</body>

Following are the syntax of Conditional comments for IE

<!--[if IE]>IE      <![endif]-->
<!--[if IE 5]>IE 5 <![endif]-->
<!--[if IE 6]>IE 6<![endif]-->
<!--[if IE 7]>IE 7<![endif]-->
<!--[if IE 8]>IE 8<![endif]-->
<!--[if gte IE 5]>IE 5 and up<![endif]-->
<!--[if lt IE 6]>IE  lower than 6<![endif]-->
<!--[if lte IE 6]>IE  lower or equal to6<![endif]-->
<!--[if gt IE 6]>IE greater than 6<![endif]-->

2. Firefox

/* Only Firefox 1 - 2 */ body:empty selector {property:value}
/* All Firefox */ @-moz-document url-prefix() { selector {property:value} }

3. Safari and Chrome

The Safari CSS hack works similar to the Firefox hack because it uses a Safari proprietary extension to CSS. By using the -webkit prefix we can target Safari and only Safari.

 @media screen and (-webkit-min-device-pixel-ratio:0) { selector {property:value} }

or

 body:nth-of-type(1) #safari { display: block; }

4. Opera

 @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { head~body selector {property:value} }
Html & CSS

CSS Formatter and Optimiser

CleanCSS is a powerful CSS optimizer and formatter. Basically, it takes your CSS code and makes it cleaner and more concise. For optimization CleanCSS is using CSSTidy – an opensource CSS parser and optimiser.

Why optimise

CSS Optimiser reduces the size of CSS file more than 30% depending on various conditions, it causes faster loading pages and lower traffic costs.

How optimization works

  • Convert Values of CSS property into shorthand notations,
    e.g margin:1px 1px 1px 1px; becomes margin:1px;
  • All unnecessary whitespace is removed
  • Comments are removed
  • The last semicolon in every block can be removed
  • All duplicate properties are merged,
    e.g h1,h2,h3{color:##FF0000}
  • colors like “black” or rgb(0,0,0) are converted to #000000 or rather #000 if possible. Some hex-codes are replaced by their color names if they are shorter.
Html & CSS

Overview: HTML 5

HTML 5 is the next major version of HTML. It introduces a new elements that will make our pages more semantic. This will make it a lot easier for search engines and screen readers to navigate our pages, and improve the web experience for everyone.

Some basics that we should know

  • DOCTYPE :

    HTML 5 uses < !DOCTYPE html>which tells browser that current document is written in HTML5 .

  • New Elements:

  1. <header>
    The header element contains introductory information to a section or page. This can involve anything from our normal documents headers (branding information) to an entire table of contents.
  2. <nav>
    The nav element is reserved for a section of a document that contains links to other pages or links to sections of the same page. Not all link groups need to be contained within the <nav> element, just primary navigation.
  3. <section>
    The section element represents a generic document or application section. It acts much the same way a <div> does by separating off a portion of the document.
  4. <article>
    The article element represents a portion of a page which can stand alone such as: a blog post, a forum entry, user submitted comments or any independent item of content.
  5. <aside>
    Aside, represents content related to the main area of the document. This is usually expressed in sidebars that contain elements like related posts, tag clouds, etc. They can also be used for pull quotes.
  6. <footer>
    The footer element is for marking up the footer of, not only the current page, but each section contained in the page. So, it’s very likely that you’ll be using the <footer>
  • APIs

HTML 5 introduces a number of APIs that help in creating Web applications. These can be used together with the new elements introduced for applications:

  1. 2D drawing API which can be used with the new canvas element.
  2. API for playing of video and audio which can be used with the new
    video and audio elements. Syntax for video embedding may like
    <video width=”400″ height=”360″ src=”vid.mp4″>
  3. An API that enables offline Web applications.
  4. Editing API in combination with a new global
    contenteditable attribute.
  5. Drag & drop API in combination with a draggable attribute.
  6. API that exposes the history and allows pages to add to it to prevent
    breaking the back button.

Demo:

I have created demo page by referring post by Mads Kjaer and HTML 5 working draft . Mads has explained very well in the post.

The structure of page is,

<!doctype html>
<html>
<head>
	<title>Page title</title>
</head>
<body>
	<header>
		<h1>Page title</h1>
	</header>
	<nav>
		<!-- Navigation -->
	</nav>
	<section>
		<!-- Main content area -->
	</section>
	<aside>
		<!-- Sidebar -->
	</aside>
	<footer>
		<!-- Footer -->
	</footer>

</body>
</html>
html5Layout
html5 Demo
Asp.net, C#, Freebies, Html & CSS, Linq, Regex

8 useful Cheat Sheets for developer

I have found awesome collections of  cheat sheets on internet which gives quick reference guide of various functionality.

Here are some  good cheats links,

Html & CSS

Sticky Footer

Why:

If content of page is small then footer might end up in the middle of the page instead of down at the bottom of the browser window.

Using Sticky Footer CSS,  footer will stick to the bottom of the page.

see at following image to see difference,

stickfooter

WebSites: Here are two sites,

1.http://ryanfait.com/sticky-footer/

2. http://www.cssstickyfooter.com/

They are compatible with all major browsers, but it requires fixed pixel height.