Skip to main content

Making the must have stylesheet

A stylesheet is like pastel in canvas! It fills effectiveness in the html structure. When i started with front-end development i felt a need for a stylesheet that i can refer every time. A designer must believe in smart work rather than hard work.
There was a need for a stylesheet that is perfect enough to avoid starting from scratch, that serves purpose for all kind of media (be it print or cross-browser) and that meets the W3C recommendations. When the search for such a framework began, I came across a few but personally i found the listed below as worth jotting down. Each one has its pros and cons.

  1. 960 grid system
  2. Yahoo! UI Library CSS Foundation
  3. Blueprint
 Every front-end developer must have his own stylesheet. I have two. One purely for wordpress and the other for other static html. I am also making one for Joomla too. This saves my valuable time and efforts.
Lets start making our framework

1. Styles related to reset
To me the idea of resetting all browser style came from the blueprint framework. Every time I use this, I can be assured that my site will look more or less similar on most browsers.

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td
 {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {line-height: 1.5; }
Include this stylesheet on the top of other stylesheet thus it can be overridden. One can also include styles related to tables or list that are included in most designs.
Say for example
a img { border: none; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
table { border-collapse: collapse; border-spacing: 0; }
2. Styles related to structure
The structure style sheet must include the styles that are related to HTML tags / IDs that determine the layout. For example this layout has 5 basic structures so our stylesheet will have width height and float for them.

Also styles to be given for FORMS, LISTS, TABLE, IMAGES, LINK and other tags like pre, code, caption, address, blockquote etc. These styles should be well organized as they will be used frequently.

/* Begin of form styles
---------------------------*/

These indication also help other developers to refer to styles easily. I once made different stylesheets for each element like forms , tables for my company’s admin-side framework. Although that doesn’t increase the file size but it does increase the code accessibility.

3. Styles related to print
Printer friendly pages can be styled by removing the unnecessary padding and margin, using the display:none; option for header, navigation links that need nt be printed.
Also the font size must have value in pt and not pixel or em ( eg font-size:7pt ) As the output of the content appears different while we print. One can check the print preview through the browser option FILE > PRINT PREVIEW

4. Styles related to typography
This stylesheet must consist of heading and paragraph related styles. Their line-height, letter spacing, font-size, font-family should be preferably in em units to maintain consistancy over browsers. Also the body tag should be given font-size as 62.5% as it resets 1em to 10px.

Comments

Popular posts from this blog

Pawna lakeside camping (Day 1)

Homeschool experience for our kid led us to understand the importance of small meaningful trips in the wild. We had been staying in a tent that had attached bathroom in the midst of a dessert during our Rajasthan trip but this one was such a raw experience. We were done with our morning routine and headed to lonavala at around 11. Listening to old songs that i love chorusing along, we reached Kailash Parbat for a lunch hault. H enjoyed homemade puranpoli that his granny made. At Kailash Parbat The weather was cold enough and H was happy to find a baby next table to play with. From here our journey was full of rough roads and yet we enjoyed looking at the scenes it had to offer. Farmer with his bullocks A farmer was ploughing his land which caught baby H's eyes. He realized we have reached another side of the world already. The tropical flowers and shrubs that H kept visiting were part of his love for colors. Pawna Lake, Thakursai Pretty Purple Flowers Ye

Kshamapna: Forgiveness

The 8days Jain festival called "Paryushan" has a very thoughtful message to give. It inspires you to forgive and forget the past grievances. "Michhami Dukkadam" is what you tell everyone, not only humans but every single soul in the universe. It is a prakrit phrase meaning 'to be forgiven' or 'may all evil that has been done be forgiven'. Why do we forgive some one? 1. Because he can be harmful 2. Because you owe him 3. Because of some religious reason like God says we must forgive and forget 4. Because that is what you call as dignity There can be many reasons. Be it. But the calmness you feel after forgiving wholeheartedly is inexpressible. Like we bath daily... our soul should also be cleaned at-least on a yearly basis! As humans we tend to have some or the other feel of grievances, hatred, enmity, jealousy etc towards others. Slowly & gradually this ill feelings give rise to feelings of revenge which ultimately is a destructive

I Salute The Mother In You

I have been traveling through BEST bus since a month now. Observing passengers especially ladies. I prefer the reserved seat for ladies. I usually get to sit immediately there.  A lady in burkha sat beside me with her 7months boy. I started. Me: "Does he have teeth yet?" She was very welcoming and showed me his tiny milky teeth. He was cute, enjoying that he was travelling. Me: "Is he your first child?" She said, “No its my third, I have other two girls. I just dropped them to school and am returning from there.” It is a personal opinion on how many kids a couple wants to have but what amazes me is how a mother takes care of as many kids she has with all the love and attention. Today while at the bus stop for boarding my ride i meet a lady. She lost her husband at much early age and had two kids to take care. she started her career at 30 and didn’t look back. Its cool how she manages her home and work together with kids. No personal life! I salute th