News Today

« »

Bishop Mar George Punnakottil and Mar Madathikandathil

Caricature made by Ignatious Kalayanthani

T C Mathew,Associate Editor,Deepika

Caricature made by Ignatious Kalayanthani.

Rev. Fr. Joseph Kochuparambil

Caricature made by Ignatious Kalayanthani

Thomas Jacob,Malayala Manorama

Caricature made by Ignatious Kalayanthani

Johny Lukose, news Director, Manorama News

Caricature made by Ignatious Kalayanthani

Ignatious Kalayanthani

Caricature made by Ignatious Kalayanthani

Dr Babu Sebastian, V C , M G University

Caricature made by Ignatious Kalayanthani

Jose Panachippuram, Malayala Manorama

Caricature made by Ignatious Kalayanthani

Ignatious Kalayanthani

Caricature made by Ignatious Kalayanthani

Sunday, July 22, 2012

Widget customization - how to style each widget differently?

 we'll learn how to tweak and style each widget (gadget) differently! Meaning:
► each of your widgets (Labels, Archive, Links, custom widget) can have it's own looks (color, font, borders, images....anything!)
► remember that WIDGET is the same thing as GADGET


There are a few simple steps you'll have to take:

choose which widget you'd like to style, and identify it in Blogger HTML code
add some CSS style in the code that will spice up our widget
► don't lose your marbles (be patient and creative)


Choosing and Identifying

Each widget added in Blogger Layout has a unique ID. We will use this ID to apply some style to our widget. So, our job is to dive into the Blogger HTML code, and locate these ID's. Let's go. From your Dashboard, go to:
LAYOUT ► EDIT HTML ► and scroll all the way to the bottom. Because I choose to style my Sidebar widgets (gadgets), I'll look inside of sidebar-wrapper. In my case, the code looks like this:
<div id='sidebar-wrapper'>
<b:section class='sidebar' id='sidebar' preferred='yes'>
<b:widget id='Label1' locked='false' title='Labels' type='Label'/>
<b:widget id='LinkList1' locked='false' title='Links' type='LinkList'/>
<b:widget id='Image1' locked='false' title='My Picture' type='Image'/>
<b:widget id='BlogArchive2' locked='false' title='Blog Archive' type='BlogArchive'/>
</b:section>
</div>
Ok. You can see the ID's of my widgets:
Label widget ID ► Label1
Links widget ID ► LinkList1
Picture widget ID ► Image1
Archive widget ID ► BlogArchive2

Sometimes, if you have a lot of custom widgets, it's hard to guess it's ID. In this case, just remember that their position is the same as they appear in your Blog frontpage. If the Labels widget is in the 1st place, it will be in the 1st place in the code too..
First step is done. Let's move on.


Styling and tweaking 

Now, the fun part. To style the widget, you'll have to know a bit of CSS. But don't worry, you can get this in minutes. In previous step , we've learned to identify the ID of our widget. Now, we'll use it. Let's start with customizing the Link List widget. From Blogger Dashboard, we'll go to:
LAYOUT ► EDIT HTML ► and locate this part (for easier searching, use CTRL + F, and type "/head"):

]]></b:skin>
</head>
ABOVE this part, you'll place the CSS style for your custom Link List Widget (gadget), so the whole thing will look like this:
#LinkList1 {
background:#FFF4BF;
padding-left:15px;
font:14px Arial;
border-bottom:2px solid #FFE25F;
}


#LinkList1 h2 {
background: url(http://i40.tinypic.com/wummhj.jpg) no-repeat bottom left;
height:35px;
padding-top:10px;
font-size:0px;
}


#LinkList1 a:link {
color:#5F5F5F;
text-decoration:none;
}
#LinkList1 a:visited {
color:#5F5F5F;
text-decoration:none;
}
#LinkList1 a:hover {
color:$titlecolor;
text-decoration:underline;
}


]]></b:skin>
</head>
 
Now to explain a bit:
The part in blue is the style for the specific widget box (in this case Link List). You can change background, font style, position, colors, borders of the widget.
Green part is defining only the HEADING of the widget. In my example, I've placed a picture instead of regular text, and with the "font-size:0px" the original heading is hidden. Pretty cool. This way, you can have different heading for each widget in your Blogger template!
In orange, I've defined how my LINK and HOVER colors will look like. I had to do this because the background of my new widget style was blending with original default link color. Now you know that you can use different colors for your links in every widget!

Here is the complete code with Labels and Picture widget (for my example):
View the code below
#Label1 {
background: #DFF7FF;
padding-left:15px;
font:14px Arial;
border-bottom:2px solid #45B7DF;
}

#Label1 h2 {
background: url(http://i40.tinypic.com/12644z4.jpg) no-repeat bottom left;
height:35px;
padding-top:10px;
margin-bottom:5px;
font-size:0px;
}

#LinkList1 {
background:#FFF4BF;
padding-left:15px;
font:14px Arial;
border-bottom:2px solid #FFE25F;
}

#LinkList1 h2 {
background: url(http://i40.tinypic.com/wummhj.jpg) no-repeat bottom left;
height:35px;
padding-top:10px;
font-size:0px;
}

#LinkList1 a:link {
color:#5F5F5F;
text-decoration:none;
}
#LinkList1 a:visited {
color:#5F5F5F;
text-decoration:none;
}
#LinkList1 a:hover {
color:$titlecolor;
text-decoration:underline;
}

#Image1 {
background:#FFDFFE;
padding-left:15px;
font:14px Arial;
border-bottom:2px solid #FFAFFD;
}

#Image1 h2 {
background: url(http://i44.tinypic.com/qywqog.jpg) no-repeat bottom left;
height:35px;
padding-top:10px;
font-size:0px;
}

#Image1 img {
border-width:0px;
padding-left:25px;
}

]]></b:skin>
</head>


Ok, I think you've got it. Remember, this was just an example. You can do a lot more. The only important thing is to remember that you have to IDENTIFY your widget, and STYLE it through your Blogger code.

courtesy:  http://www.blogbulk.com

Saturday, July 14, 2012

കമ്പ്യൂട്ടര്‍ ക്വിസ്,




1. Which of the following are the major components in a computer




  • a) CPU, CD_Rom, Mouse, Keyboard



  • b) Memory, Video card, Monitor

  • c) Modem, Printer, Screen

  • d) CPU, Memory, System bus, Input H/w, Output H/w








2. How the information is transformed from one component to another component in a system?




  • a) System bus

  • b) Memory

  • c) Keyboard

  • d) Monitor





3. MS-Access, MS-Foxpro is the examples of what type of software?


  • a) Spread Sheet



  • b) Presentation Software

  • c) Database Management

  • d) None of the above








4. Windows operating system have


  • a) Graphical User Interface



  • b) Command based Interface

  • c) Both a and b

  • d) None of the above





5. ___ Allows more data to be stored on a disk?


  • a) Data Compression



  • b) Disk Defragmentation

  • c) Both a and b

  • d) None of the above








6. A text-based language with codes or tags used for developing web pages is called?


  • a) Java


  • b) HTML

  • c) Both a and b

  • d) None of the above








7. CASE stands for?



  • a) Computer Aided Software Engineering




  • b) Common Aided Software Engineering

  • c) Computer Access Software Engineering

  • d) Computer Aided Software Engine





8. The primary job of the information system is?


  • a) Data collection

  • b)Data transfer

  • c) Transform inputs to information

  • d) None of the above








9. ___ Is the software that allows the computer to interact with users and hardware?


  • a) System Software



  • b) Application software

  • c) Development software

  • d) None of the above







10. This type of boot occurs when the computer is already on, and you restart it without turning off the power?


  • a) Generic boot

  • b) Live boot

  • c) Warm boot

  • d) Cold boot


Saturday, July 7, 2012

Three Columns Template (I)

The popular templates – Minima, Rounders, Denim, Dots, Scribe and Sand Dollar. Here give you a step by step guide to insert a third column into the templates.


If you are not sure what your template is, under Template -> Edit HTML, look for the “Blogger Template Style” Name. If it says “Thisaway”, you can follow this guide to customize your template.

For other templates, please refer to our articles and guides on:-
1. Three Columns Denim Template;
2. Three Columns Dots Template;
3. Three Columns Minima Template;
4. Three Columns Rounders Template;
5. Three Columns Rounders 2 Template;
6. Three Columns Rounders 3 Template;
7. Three Columns Rounders 4 Template;
8. Three Columns Sand Dollar Template;
9. Three Columns Scribe Template.

Note: Some sites offer free three-column templates for download. If you are starting a new blog, you may look up these sites and use their templates. However, if you have an existing blog and merely want to expand the template to include another column, our guides would be helpful. What we do is to take the standard Blogger templates and show you how to add a new sidebar. This approach gives you total control over the changes, and if you have bookmarked this page, you can revisit it in future should you want to reverse the changes. It is also a safer method, since there could be a few out there who may introduce malicious scripts or blog virus into their customized templates without you knowing.


Before you begin to do anything, remember to backup your template. Go to Template -> Edit HTML. Click the “Download Full Template” link to save a copy of your template.



Thisaway Template


The final three-column Thisaway template should look like this:-


Three Columns Thisaway Template (I)


After you have backed up the current template, scroll to these lines in the template code:-



/* global
-------------- */
body {
margin: 0;
text-align: center;
min-width: 760px;
background: #ce8b43 url(http://www.blogblog.com/thisaway/bg_body.gif) repeat-x left top;
color: $textColor;
font-size: small;
}

blockquote {
margin: 0;
padding: 0 10px 0 10px;
border-left: 6px solid #f7e8d8;
border-right: 6px solid #f7e8d8;
color: $postTitleColor;
}

code {
color: $postTitleColor;
}

hr {
display: none;
}

/* layout
-------------- */
#outer-wrapper {
margin: 0 auto;
width: 760px;
text-align: left;
font: $bodyFont;
}

#header-wrapper {
padding-bottom: 15px;
background: url(http://www.blogblog.com/thisaway/bg_header_bottom.gif) no-repeat left bottom;
}

#header {
background: #634320 url(http://www.blogblog.com/thisaway/bg_header.gif) repeat-x left bottom;
}

#content-wrapper {
position: relative;
width: 760px;
background: #f7f0e9 url(http://www.blogblog.com/thisaway/bg_main_wrapper.gif) repeat-y left top;
}

#main-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: left;
margin: 0 0 0 3px;
padding: 0;
width: 483px;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#main {
padding: 22px 8px 0 8px;
background: url(http://www.blogblog.com/thisaway/bg_content.gif) repeat-x left top;
}

.post {
margin: 0 8px 14px 21px;
padding: 0;
border-bottom: 3px solid #f7e8d8;
}

#comments {
margin: 0 16px 14px 29px;
padding: 10px;
border: 1px solid #f0e0ce;
background-color: #f5ede4;
}

#sidebar-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: right;
margin: 0 3px 0 0;
width: 269px;
color: $textColor;
line-height: 1.4em;
font-size: 90%;
background: url(http://www.blogblog.com/thisaway/bg_sidebar.gif) repeat-x left top;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#sidebar {
padding: 7px 11px 0 14px;
background: url(http://www.blogblog.com/thisaway/bg_sidebar_arrow.gif) repeat-y 179px 0;
}

#sidebar .widget {
margin-bottom: 20px;
}

#footer-wrapper {
padding-top: 15px;
background: url(http://www.blogblog.com/thisaway/bg_footer_top.gif) no-repeat left top;
clear: both;
}

#footer {
background: #493015 url(http://www.blogblog.com/thisaway/bg_footer.gif) repeat-x left top;
text-align: center;
min-height: 2em;
}


Change, amend or insert the portions (shown in red):-


/* global
-------------- */
body {
margin: 0;
text-align: center;
min-width: 987px;
background: #ce8b43 url(http://www.blogblog.com/thisaway/bg_body.gif) repeat-x left top;
color: $textColor;
font-size: small;
}

blockquote {
margin: 0;
padding: 0 10px 0 10px;
border-left: 6px solid #f7e8d8;
border-right: 6px solid #f7e8d8;
color: $postTitleColor;
}

code {
color: $postTitleColor;
}

hr {
display: none;
}

/* layout
-------------- */
#outer-wrapper {
margin: 0 auto;
width: 987px;
text-align: left;
font: $bodyFont;
}

#header-wrapper {
padding-bottom: 15px;
background: url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/ty/bg_header_bottom_2.gif) no-repeat left bottom;
}

#header {
background: #634320 url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/ty/bg_header_2.gif) repeat-x left bottom;
}

#content-wrapper {
position: relative;
width: 987px;
background: #f7f0e9 url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/ty/bg_main_wrapper_2.gif) repeat-y left top;
}

#main-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: left;
margin: 0 0 0 3px;
padding: 0;
width: 483px;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#main {
padding: 22px 8px 0 8px;
background: url(http://www.blogblog.com/thisaway/bg_content.gif) repeat-x left top;
}

.post {
margin: 0 8px 14px 21px;
padding: 0;
border-bottom: 3px solid #f7e8d8;
}

#comments {
margin: 0 16px 14px 29px;
padding: 10px;
border: 1px solid #f0e0ce;
background-color: #f5ede4;
}

#sidebar-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: right;
margin: 0 3px 0 0;
width: 247px;
color: $textColor;
line-height: 1.4em;
font-size: 90%;
background: url(http://www.blogblog.com/thisaway/bg_sidebar.gif) repeat-x left top;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#sidebar {
padding: 7px 11px 0 14px;
background: url(http://www.blogblog.com/thisaway/bg_sidebar_arrow.gif) repeat-y 159px 0;
}

#sidebar .widget {
margin-bottom: 20px;
}

#newsidebar-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: left;
margin: 0 0 0 3px;
width: 247px;
color: $textColor;
line-height: 1.4em;
font-size: 90%;
background: url(http://www.blogblog.com/thisaway/bg_sidebar.gif) repeat-x left top;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#newsidebar {
padding: 7px 11px 0 14px;
background: url(http://www.blogblog.com/thisaway/bg_sidebar_arrow.gif) repeat-y 159px 0;
}

#newsidebar .widget {
margin-bottom: 20px;
}

#footer-wrapper {
padding-top: 15px;
background: url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/ty/bg_footer_top_2.gif) no-repeat left top;
clear: both;
}

#footer {
background: #493015 url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/ty/bg_footer_2.gif) repeat-x left top;
text-align: center;
min-height: 2em;
}


We have done up new background images to accommodate the new widths. The widths of the sidebars are slightly reduced.

Scroll down to these lines:-



/** Page structure tweaks for layout editor wireframe */

body#layout #main,
body#layout #sidebar {
padding: 0;
}


Change them to this:-


/** Page structure tweaks for layout editor wireframe */

body#layout #main,
body#layout #sidebar,
body#layout #newsidebar {
padding: 0;
}


Further down the template, look for this and add the lines (shown in red):-


<div id='newsidebar-wrapper'>
<b:section class='sidebar' id='newsidebar' preferred='yes'>
<b:widget id='NewProfile' locked='false' title='About Me' type='Profile'/>
</b:section>
</div>

<div id='main-wrapper'>
<b:section class='main' id='main' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
</div>


This places your Profile in the left sidebar. This can be removed later. Now, “Preview” the template to view the changes and if see the new sidebar nicely aligned, click “Save Template”. Remove the Profile if you don't want it there by going back to Template -> Page Elements and removing the Profile widget. Refresh your Blog to see your new Three Column Thisaway layout!

Thisaway Blue Template


The final three-column Thisaway Blue Template should look like this:-


Three Columns Thisaway Template (I)


After you have backed up the current template, scroll to these lines in the template code:-



/* global
-------------- */
body {
margin: 0;
text-align: center;
min-width: 760px;
background: #4386ce url(http://www.blogblog.com/thisaway_blue/bg_body.gif) repeat-x left top;
color: $textColor;
font-size: small;
}

blockquote {
margin: 0;
padding: 0 10px 0 10px;
border-left: 6px solid #d8e7f78;
border-right: 6px solid #d8e7f7;
color: $postTitleColor;
}

code {
color: $postTitleColor;
}

hr {
display: none;
}

/* layout
-------------- */
#outer-wrapper {
margin: 0 auto;
width: 760px;
text-align: left;
font: $bodyFont;
}

#header-wrapper {
padding-bottom: 15px;
background: url(http://www.blogblog.com/thisaway_blue/bg_header_bottom.gif) no-repeat left bottom;
}

#header {
background: #204063 url(http://www.blogblog.com/thisaway_blue/bg_header.gif) repeat-x left bottom;
}

#content-wrapper {
position: relative;
width: 760px;
background: #f7f0e9 url(http://www.blogblog.com/thisaway_blue/bg_main_wrapper.gif) repeat-y left top;
}

#main-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: left;
margin: 0 0 0 3px;
padding: 0;
width: 483px;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#main {
padding: 22px 8px 0 8px;
background: url(http://www.blogblog.com/thisaway_blue/bg_content.gif) repeat-x left top;
}

.post {
margin: 0 8px 14px 21px;
padding: 0;
border-bottom: 3px solid #d8e7f7;
}

#comments {
margin: 0 16px 14px 29px;
padding: 10px;
border: 1px solid #cedef0;
background-color: #e4ecf5;
}

#sidebar-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: right;
margin: 0 3px 0 0;
width: 269px;
color: $textColor;
line-height: 1.4em;
font-size: 90%;
background: url(http://www.blogblog.com/thisaway_blue/bg_sidebar.gif) repeat-x left top;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#sidebar {
padding: 7px 11px 0 14px;
background: url(http://www.blogblog.com/thisaway_blue/bg_sidebar_arrow.gif) repeat-y 179px 0;
}

#sidebar .widget {
margin-bottom: 20px;
}

#footer-wrapper {
padding-top: 15px;
background: url(http://www.blogblog.com/thisaway_blue/bg_footer_top.gif) no-repeat left top;
clear: both;
}

#footer {
background: #152e49 url(http://www.blogblog.com/thisaway_blue/bg_footer.gif) repeat-x left top;
text-align: center;
min-height: 2em;
}

Change, amend or insert the portions (shown in red):-



/* global
-------------- */
body {
margin: 0;
text-align: center;
min-width: 987px;
background: #4386ce url(http://www.blogblog.com/thisaway_blue/bg_body.gif) repeat-x left top;
color: $textColor;
font-size: small;
}

blockquote {
margin: 0;
padding: 0 10px 0 10px;
border-left: 6px solid #d8e7f78;
border-right: 6px solid #d8e7f7;
color: $postTitleColor;
}

code {
color: $postTitleColor;
}

hr {
display: none;
}

/* layout
-------------- */
#outer-wrapper {
margin: 0 auto;
width: 987px;
text-align: left;
font: $bodyFont;
}

#header-wrapper {
padding-bottom: 15px;
background: url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/tyb/bg_header_bottom_2.gif) no-repeat left bottom;
}

#header {
background: #204063 url(http://www.blogblog.com/thisaway_blue/bg_header.gif) repeat-x left bottom;
}

#content-wrapper {
position: relative;
width: 987px;
background: #f7f0e9 url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/tyb/bg_main_wrapper_2.gif) repeat-y left top;
}

#main-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: left;
margin: 0 0 0 3px;
padding: 0;
width: 483px;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#main {
padding: 22px 8px 0 8px;
background: url(http://www.blogblog.com/thisaway_blue/bg_content.gif) repeat-x left top;
}

.post {
margin: 0 8px 14px 21px;
padding: 0;
border-bottom: 3px solid #d8e7f7;
}

#comments {
margin: 0 16px 14px 29px;
padding: 10px;
border: 1px solid #cedef0;
background-color: #e4ecf5;
}

#sidebar-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: right;
margin: 0 3px 0 0;
width: 247px;
color: $textColor;
line-height: 1.4em;
font-size: 90%;
background: url(http://www.blogblog.com/thisaway_blue/bg_sidebar.gif) repeat-x left top;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#sidebar {
padding: 7px 11px 0 14px;
background: url(http://www.blogblog.com/thisaway_blue/bg_sidebar_arrow.gif) repeat-y 159px 0;
}

#sidebar .widget {
margin-bottom: 20px;
}

#newsidebar-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: left;
margin: 0 0 0 3px;
width: 247px;
color: $textColor;
line-height: 1.4em;
font-size: 90%;
background: url(http://www.blogblog.com/thisaway_blue/bg_sidebar.gif) repeat-x left top;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

#newsidebar {
padding: 7px 11px 0 14px;
background: url(http://www.blogblog.com/thisaway_blue/bg_sidebar_arrow.gif) repeat-y 159px 0;
}

#newsidebar .widget {
margin-bottom: 20px;
}

#footer-wrapper {
padding-top: 15px;
background: url(http://i191.photobucket.com/albums/z76/tipsfornewbloggers/tyb/bg_footer_top_2.gif) no-repeat left top;
clear: both;
}

#footer {
background: #152e49 url(http://www.blogblog.com/thisaway_blue/bg_footer.gif) repeat-x left top;
text-align: center;
min-height: 2em;
}


We have done up new background images to accommodate the new widths. The widths of the sidebars are slightly reduced.

Scroll down to these lines:-



/** Page structure tweaks for layout editor wireframe */

body#layout #main,
body#layout #sidebar {
padding: 0;
}


Change them to this:-


/** Page structure tweaks for layout editor wireframe */

body#layout #main,
body#layout #sidebar,
body#layout #newsidebar {
padding: 0;
}


Further down the template, look for this and add the lines (shown in red):-


<div id='newsidebar-wrapper'>
<b:section class='sidebar' id='newsidebar' preferred='yes'>
<b:widget id='NewProfile' locked='false' title='About Me' type='Profile'/>
</b:section>
</div>

<div id='main-wrapper'>
<b:section class='main' id='main' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
</div>


This places your Profile in the left sidebar. This can be removed later. Now, “Preview” the template to view the changes and if see the new sidebar nicely aligned, click “Save Template”. Remove the Profile if you don't want it there by going back to Template -> Page Elements and removing the Profile widget. Refresh your Blog to see your new Three Column Thisaway Blue layout!

Align Header Title and Description


The Header title and description in the Thisaway and Thisaway Blue templates are aligned to the left. To adjust them to the center or a fixed position in the Header, read the guidelines at Header Image and Title Alignment (II).


This article continues at Three Columns Thisaway Template (II). If you want to insert a second sidebar into the Thisaway Green or Thisaway Rose templates, follow our tutorials there.


© Tips for New Bloggers

Tuesday, July 3, 2012

How to display widgets only on home page of blogger


It mean widget display only on homepage and hide from post,static and archive page.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.url == data:blog.homepageUrl'>

WIDGET CODE GOES HERE

</b:if>

where WIDGET CODE GOES HERE is the code of the widget you want to show or hide.

2.How to display widgets only on post pages of blogger

It mean widget display only on post pages and hide from homepage,static and archive page.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.pageType == "item"'>

WIDGET CODE GOES HERE

</b:if>

3.How to display widgets only on static pages of blogger.

It mean widget display only on static pages and hide from homepage,post and archive pages.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.pageType == "static_page"'>

WIDGET CODE GOES HERE

</b:if>

4.How to display widgets on post pages and static pages of blogger.

It mean widget display on post pages & static pages and hide from homepage.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.pageType != &quot;index&quot;'>

WIDGET CODE GOES HERE

</b:if>

5.How to display widgets on home page and static pages of blogger.

It mean widget display on static pages & home page and hide from post pages.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.pageType != &quot;item&quot;'>

WIDGET CODE GOES HERE

</b:if>

6.How to display widgets in home page and posts pages of blogger.

It mean widget display on home page and posts pages and hide from static pages.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

WIDGET CODE GOES HERE

</b:if>

7.How to display widgets only on archive pages of blogger.

It mean widget display on archive pages and hide from any other pages.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.pageType == &quot;archive&quot;'>

WIDGET CODE GOES HERE

</b:if>


8.How to display widgets only on a specific page of blogger.

It mean widget display on specific page and hide from any other pages.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.url == &quot;Your_URL_Here&quot;'>

WIDGET CODE GOES HERE

</b:if>

9.How to display widgets except any one specific page of blogger.

It mean widget display on all page without selected specific page.Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.url != &quot;Your_URL_Here&quot;'>

WIDGET CODE GOES HERE

</b:if>

  • In the 8th case put your page url instead of Your_URL_Here,at which you want to display gadget and in the 9th case you have to put your page url at which you don't display gadget.

How To Control Blogger’s Official Widgets?

The same procedure can be applied to Blogger’s official widgets like About Me, Archives, Poll etc. For controlling that widgets do this,

1.Go To Blogger > Design > Edit HTML
2.Backup your template
3.Check the Expand Widgets Templates Box
4.Search for the title of the widget you want to control
5.The code for the widget will look something similar to this one,

<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>

LARGE PART OF WIDGET CODE

</b:includable>
</b:widget>

To explore the title in place of WIDGET-TITLE-HERE you will find two similar codes like those I have shown in bolded green You just need to add the Controlling codes in the following manner.For example if you wish to show a widget at post pages only then do this see below,

<b:widget id="HTML" locked="false" title="WIDGET-TITLE-HERE" type="Profile">
<b:includable id="main">
<b:if cond='data:blog.pageType == &quot;item&quot;'>
LARGE CHUNK OF WIDGET CODE
</b:includable> 
</b:widget>

How to Show blogger widget on homepage only?

Some questions that are most asked are : How to Show blogger widget on homepage only? How can I show widgets only on sub pages? How can I hide widgets on Static pages? How to show widgets on selected pages in blogger? To answer all these questions today's tutorial will be a delicious one. Its really important to control widget Display in Blogger. some widgets are meant for homepage only while some makes sense when you show it at your Contact Pages, About Me pages or static pages. So how do we actually do this. The trick is really simple. You just need to enclose your widgets in few pieces of codes. So lets jump straight on how to manage widgets on different pages in blogger.
Its often the HTML/JavaScript widget that is widely used for adding your customized widgets to Blogger and its mostly this widget that needs to be easily managed. Since you often paste some widget code inside HTML/JavaScript widgets so the only extra thing that you need to do in order to control widget’s display is to enclose that code between two pieces of code as shown in each control codes below,

How to Show Widgets Only On Homepages?

Simply enclose the code inside HTML/JavaScript widget between these lines,
<b:if cond='data:blog.url == data:blog.homepageUrl'>
WIDGET CODE GOES HERE
</b:if>
where WIDGET CODE GOES HERE is the code of the widget you want to show or hide.

How to Hide Widgets On Homepages?

Same procedure here,
<b:if cond='data:blog.pageType == "item"'>
WIDGET CODE GOES HERE
</b:if>

How To Show Widgets Only On Static Pages?

<b:if cond='data:blog.pageType == "static_page"'>
WIDGET CODE GOES HERE
</b:if>

How To Hide Widgets On Static Pages?

<b:if cond='data:blog.pageType != "static_page"'>
WIDGET CODE GOES HERE
</b:if>

How To Show a Widget On a Selected Post Only?

<b:if cond='data:blog.url == "URL OF Selected Post"'>
WIDGET CODE GOES HERE
</b:if>

How To Hide a Widget On a Selected Post?

<b:if cond='data:blog.url != "URL OF Selected Post"'>
WIDGET CODE GOES HERE
</b:if>

How To Control Blogger’s Official Widgets?

The same procedure can be applied to Blogger’s official widgets like About Me, Archives, Poll etc. For controlling that widgets do this,
  1. Go To Blogger > Design > Edit HTML
  2. Backup your template
  3. Check the Expand Widgets Templates Box
  4. Search for the title of the widget you want to control
  5. The code for the widget will look something similar to this one,
<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>
LARGE CHUNK OF WIDGET CODE
</b:includable> </b:widget>
On finding the title in place of WIDGET-TITLE-HERE you will find two similar codes like those I have shown in bolded blue  You just need to add the Controlling codes in the following manner. For example if you wish to show a widget at Homepage only then do this,
<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
LARGE CHUNK OF WIDGET CODE
</b:if>
</b:includable> </b:widget>
That’s it. Do the same for applying any controlling code.

How To Controll Widgets in blogger ?


This is the Procedure applied to Blogger’s official widgets like About Me, Archives, Poll etc. For controlling that widgets do this,
  1. Go To Blogger >> Design (or) Template(for new interface) >> Edit HTML
  2. Backup your template
  3. Check the Expand Widgets Templates Box
  4. Search for the title of the widget you want to control
  5. The code for the widget will look something similar to this one,
<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>
WIDGET CODE GOES HERE
</b:includable> </b:widget>
On finding the title in place of WIDGET-TITLE-HERE you will find two similar codes like those I have shown in blueYou just need to add the Controlling codes in the following manner. For example if you wish to show a widget at Homepage only then do this,
<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
WIDGET CODE GOES HERE
</b:if>
</b:includable> </b:widget>
where WIDGET CODE GOES HERE is the code of the widget you want to show or hide.


How to Hide Widgets On Homepages?

The same procedure can be applied to hide widget on homepage.
<b:if cond='data:blog.pageType == "item"'>
WIDGET CODE GOES HERE
</b:if>

How To Show Widgets Only On Static Pages?

<b:if cond='data:blog.pageType == "static_page"'>
WIDGET CODE GOES HERE
</b:if>

How To Hide Widgets On Static Pages?

<b:if cond='data:blog.pageType != "static_page"'>
WIDGET CODE GOES HERE
</b:if>

How To Show a Widget On a Selected Post Only?

<b:if cond='data:blog.url == "URL OF Selected Post"'>
WIDGET CODE GOES HERE
</b:if>

How To Hide a Widget On a Selected Post?

<b:if cond='data:blog.url != "URL OF Selected Post"'>
WIDGET CODE GOES HERE
</b:if>

That’s it. Do the same for applying any controlling code.

20 Useful CSS Tips for blogging

In the old days, we depend a lot of on developers and programmers to help update the website, even when it’s just a minor one. Thanks to the CSS and it’s flexibility, styles can be extract independently away from the codes. Now, with some basic understanding of CSS, even a novice can easily change the style of a website.
Whether you are interested in picking up CSS to create your own website, or merely to tweak your blog’s look and feel a little – it’s always good to start with the fundamentals to gain a stronger foundation. Let’s take a look at some CSS Tips we thought might be useful for beginners. Full list after jump.

  1. Use reset.css

    When it comes to rendering CSS styles, browsers like Firefox and Internet Explorer have different ways of handling them. reset.css resets all fundamental styles, so you starts with a real blank new stylesheets.
    Here are few commonly used reset.css frameworks – Yahoo Reset CSS, Eric Meyer’s CSS Reset, Tripoli
  2. Use Shorthand CSS

    Shorthand CSS gives you a shorter way of writing your CSS codes, and most important of all – it makes the code clearner and easier to understand.
    Instead of creating CSS like this
    .header {
          background-color: #fff;
          background-image: url(image.gif);
          background-repeat: no-repeat;
          background-position: top left; 
        }
    It can be short-handed into the following:
    .header {
          background: #fff url(image.gif) no-repeat top left
        }
    MoreIntroduction to CSS Shorthand, Useful CSS shorthand properties
  3. Understanding Class and ID

    These two selectors often confuse beginners. In CSS, class is represented by a dot "." while id is a hash ‘#". In a nutshell id is used on style that is unique and don’t repeat itself, class on the other side, can be re-use.
    MoreClass vs. ID | When to use Class, ID | Applying Class and ID together
  4. Power of <li>

    <li> a.k.a link list, is very useful when they are use correctly with <ol> or <ul>, particulary to style a navigation menu.
    MoreTaming Lists, Amazing LI
  5. Forget <table>, try <div>

    One of the greatest advantage of CSS is the use of <div> to achieve total flexibility in terms of styling. <div> are unlike <table>, where contents are ‘locked’ within a <td>‘s cell. It’s safe to say most <table> layouts are achievable with the use of <div> and proper styling, well maybe except massive tabular contents.
    MoreTables are dead, Tables Vs. CSS, CSS vs tables
  6. CSS Debugging Tools

    It’s always good to get instant preview of the layout while tweaking the CSS, it helps understanding and debugging CSS styles better. Here are some free CSS debugging tools you can install on your browser: FireFox Web Developer, DOM Inspector, Internet Explorer Developer Toolbar, and Firebug.
    firebug 20 Useful CSS Tips For Beginners
  7. Avoid Superfluous Selectors

    Sometimes your CSS declaration can be simpler, meaning if you find yourself coding the following:
    • ul li { ... }
    • ol li { ... }
    • table tr td { ... }
    They can be shorten down to just
    • li { ... }
    • td { ... }
    Explanation: <li> will only exist within <ul> or <ol> and <td> will only be inside <tr> and <table> so there’s really not necessary to re-insert them.
  8. Knowing !important

    Any style marked with !important will be taken into use regardlessly if there’s a overwriting rule below it.
    .page { background-color:blue !important; background-color:red;}
    In the example above, background-color:blue will be adapted because it’s marked with !important, even when there’s a background-color:red; below it. !important is used in situation where you want to force a style without something overwriting it, however it may not work in Internet Explorer.
  9. Replace Text with Image

    This is commonly practice to replace <h1>title</h1> from a text based title to an image. Here’s how you do it.
    h1 {
    text-indent:-9999px;
    background:url("title.jpg") no-repeat;
    width:100px;
    height:50px;
    }
    Explanation: text-indent:-9999px; throws your text title off screen, replaced by an image declared by background: {...} with a fixed width and height.
  10. Understand CSS Positioning

    The following article gives you a clear understanding in using CSS positioning – position: {...}
    MoreLearn CSS Positioning in Ten Steps
  11. CSS @import vs <link>

    There are 2 ways to call an external CSS file – respectively using @import and <link>. If you are uncertain which method to use, here’s few articles to help you decide.
    MoreDifference Between @import and link
  12. Designing Forms in CSS

    Web forms can be easily design and customize with CSS. These following articles show you how:
    MoreTable-less form, Form Garden, Styling even more form controls
    select 20 Useful CSS Tips For Beginners
  13. Get Inspired

    If you are looking around for nicely designed CSS-based website for inspiration, or just simply browsing to find some good UI, here are some CSS showcase site we recommend:
    css showcase 20 Useful CSS Tips For Beginners
    Need more? Here’s a round up of 74 CSS Galleries.
  14. Rounded Corners in CSS

    This following article gives you an idea how to create cross-browser compatible rounded borders with CSS.
    rounded borders 20 Useful CSS Tips For Beginners
  15. Keep CSS Codes Clean

    If your CSS codes are messy, you are going to end up coding in confusion and having a hard time refereing the previous code. For starters, you can create proper indentation, comment them properly.
    More12 Principles For Keeping Your Code Clean, Format CSS Codes Online
  16. Typography Measurement: px vs em

    Having problem choosing when to use measurement unit px or em? These following articles might give you a better understanding on the typography units.
    MoreUnits of Measurement in CSS, CSS Font size explained, Using Points, Pixels, Ems, or Percentages for CSS Fonts
  17. CSS Browsers Compatibility Table

    We all know each browser has different ways of rendering CSS styles. It’s good to have a reference, a chart or a list that shows the entire CSS compatibility for each browser.
    CSS support table: #1, #2, #3, #4.
    csstable 20 Useful CSS Tips For Beginners
  18. Design Multicolumns in CSS

    Having problem getting the left, middle and right column to align properly? Here are some articles that might help:
    multicolumns 20 Useful CSS Tips For Beginners
  19. Get a Free CSS Editors

    Dedicated editors are always better than a notepad. Here are some we recommend:
    More – Simple CSS, Notepad ++, A Style CSS Editor
    notepadplus 20 Useful CSS Tips For Beginners
  20. Understanding Media Types

    There are few media types when you declare CSS with <link>. print, projection and screen are few of the commonly used types. Understanding and using them in proper ways allow better user accessibility. The following article explains how to deal with CSS Media types.
    MoreCSS and Media Types, W3 Media Types, CSS Media Types, CSS2 Media Types

blogging : Start with HTML

Start with a title
Every HTML document needs a title. Here is what you need to type:
<title>My first HTML document</title>
Change the text from "My first HTML document" to suit your own needs. The title text is preceded by the start tag <title> and ends with the matching end tag </title>. The title should be placed at the beginning of your document.
To try this out, type the above into a text editor and save the file as "test.html", then view the file in a web browser. If the file extension is ".html" or ".htm" then the browser will recognize it as HTML. Most browsers show the title in the window caption bar. With just a title, the browser will show a blank page. Don't worry. The next section will show how to add displayable content.
Add headings and paragraphs
If you have used Microsoft Word, you will be familiar with the built in styles for headings of differing importance. In HTML there are six levels of headings. H1 is the most important, H2 is slightly less important, and so on down to H6, the least important.
Here is how to add an important heading:
<h1>An important heading</h1>
and here is a slightly less important heading:
<h2>A slightly less important heading</h2>
Each paragraph you write should start with a <p> tag. The </p> is optional, unlike the end tags for elements like headings. For example:
<p>This is the first paragraph.</p>

<p>This is the second paragraph.</p>

Adding a bit of emphasis

You can emphasize one or more words with the <em> tag, for instance:
This is a really <em>interesting</em> topic!

Adding interest to your pages with images

Images can be used to make your Web pages distinctive and greatly help to get your message across. The simple way to add an image is using the <img> tag. Let's assume you have an image file called "peter.jpg" in the same folder/directory as your HTML file. It is 200 pixels wide by 150 pixels high.
<img src="peter.jpg" width="200" height="150">
The src attribute names the image file. The width and height aren't strictly necessary but help to speed the display of your Web page. Something is still missing! People who can't see the image need a description they can read in its absence. You can add a short description as follows:
<img src="peter.jpg" width="200" height="150"
alt="My friend Peter">
The alt attribute is used to give the short description, in this case "My friend Peter". For complex images, you may need to also give a longer description. Assuming this has been written in the file "peter.html", you can add one as follows using the longdesc attribute:
<img src="peter.jpg" width="200" height="150"
alt="My friend Peter" longdesc="peter.html">
You can create images in a number of ways, for instance with a digital camera, by scanning an image in, or creating one with a painting or drawing program. Most browsers understand GIF and JPEG image formats, newer browsers also understand the PNG image format. To avoid long delays while the image is downloaded over the network, you should avoid using large image files.
Generally speaking, JPEG is best for photographs and other smoothly varying images, while GIF and PNG are good for graphics art involving flat areas of color, lines and text. All three formats support options for progressive rendering where a crude version of the image is sent first and progressively refined.

Adding links to other pages

What makes the Web so effective is the ability to define links from one page to another, and to follow links at the click of a button. A single click can take you right across the world!
Links are defined with the <a> tag. Lets define a link to the page defined in the file "peter.html" in the same folder/directory as the HTML file you are editing:
This a link to <a href="peter.html">Peter's page</a>.
The text between the <a> and the </a> is used as the caption for the link. It is common for the caption to be in blue underlined text.
If the file you are linking to is in a parent folder/directory, you need to put "../" in front of it, for instance:
<a href="../mary.html">Mary's page</a>
If the file you are linking to is in a subdirectory, you need to put the name of the subdirectory followed by a "/" in front of it, for instance:
<a href="friends/sue.html">Sue's page</a>
The use of relative paths allows you to link to a file by walking up and down the tree of directories as needed, for instance:
<a href="../college/friends/john.html">John's page</a>
Which first looks in the parent directory for another directory called "college", and then at a subdirectory of that named "friends" for a file called "john.html".
To link to a page on another Web site you need to give the full Web address (commonly called a URL), for instance to link to www.w3.org you need to write:
This is a link to <a href="http://www.w3.org/">W3C</a>.
You can turn an image into a hypertext link, for example, the following allows you to click on the company logo to get to the home page:
<a href="/"><img src="logo.gif" alt="home page"></a>
This uses "/" to refer to the root of the directory tree, i.e. the home page.

Three kinds of lists

HTML supports three kinds of lists. The first kind is a bulletted list, often called an unordered list. It uses the <ul> and <li> tags, for instance:
<ul>
  <li>the first list item</li>

  <li>the second list item</li>

  <li>the third list item</li>
</ul>
Note that you always need to end the list with the </ul> end tag, but that the </li> is optional and can be left off. The second kind of list is a numbered list, often called an ordered list. It uses the <ol> and <li> tags. For instance:
<ol>
  <li>the first list item</li>

  <li>the second list item</li>

  <li>the third list item</li>
</ol>
Like bulletted lists, you always need to end the list with the </ol> end tag, but the </li> end tag is optional and can be left off.
The third and final kind of list is the definition list. This allows you to list terms and their definitions. This kind of list starts with a <dl> tag and ends with </dl> Each term starts with a <dt> tag and each definition starts with a <dd>. For instance:
<dl>
  <dt>the first term</dt>
  <dd>its definition</dd>

  <dt>the second term</dt>
  <dd>its definition</dd>

  <dt>the third term</dt>
  <dd>its definition</dd>
</dl>
The end tags </dt> and </dd> are optional and can be left off. Note that lists can be nested, one within another. For instance:
<ol>
  <li>the first list item</li>

  <li>
    the second list item
    <ul>
      <li>first nested item</li>
      <li>second nested item</li>
    </ul>
  </li>

  <li>the third list item</li>
</ol>
You can also make use of paragraphs and headings etc. for longer list items.

HTML has a head and a body

If you use your web browser's view source feature (see the View or File menus) you can see the structure of HTML pages. The document generally starts with a declaration of which version of HTML has been used, and is then followed by an <html> tag followed by <head> and at the very end by </html>. The <html> ... </html> acts like a container for the document. The <head> ... </head> contains the title, and information on style sheets and scripts, while the <body> ... </body> contains the markup with the visible content. Here is a template you can copy and paste into your text editor for creating your own pages:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title> replace with your document's title </title>
</head>
<body>

replace with your document's content

</body>
</html>
Tidying up your markup
A convenient way to automatically fix markup errors is to use HTML Tidy which also tidies the markup making it easier to read and easier to edit. I recommend you regularly run Tidy over any markup you are editing. Tidy is very effective at cleaning up markup created by authoring tools with sloppy habits. Tidy is available for a wide range of operating systems from the TidyLib Sourceforge site, and has also been integrated into a variety of HTML editing tools.

blogger tricks - Use the style element

This is a short guide to styling your Web pages. It will show you how to use W3C's Cascading Style Sheets language (CSS) as well as alternatives using HTML itself. The route will steer you clear of most of the problems caused by differences between different brands and versions of browsers.
For style sheets to work, it is important that your markup be free of errors. A convenient way to automatically fix markup errors is to use the HTML Tidy utility. This also tidies the markup making it easier to read and easier to edit. I recommend you regularly run Tidy over any markup you are editing. Tidy is very effective at cleaning up markup created by authoring tools with sloppy habits.
The following will teach you how to:
  • use the style element
  • link to separate style sheets
  • set page margins
  • set left and right and first-line indents
  • set the amount of whitespace above and below
  • set the font type, style and size
  • add borders and backgrounds
  • set colors with named or numeric values
  • add style for browsers that don't understand CSS

Getting started

Let's start with setting the color of the text and the background. You can do this by using the STYLE element to set style properties for the document's tags:
<style type="text/css">
  body { color: black; background: white; }
</style>
The style element is placed within the document head. Here is a template HTML file showing where the above style element fits. You can copy and paste this into your editor as a convenient way to experiment with CSS style sheets:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> replace with your document's title </title>
<style type="text/css">
  body { color: black; background: white; }
</style>
</head>
<body>

replace with your document's content

</body>
</html>
The stuff between the <style> and </style> is written in special notation for style rules. Each rule starts with a tag name followed by a list of style properties bracketed by { and }. In this example, the rule matches the body tag. As you will see, the body tag provides the basis for setting the overall look and feel of your Web page.
Each style property starts with the property's name, then a colon and lastly the value for this property. When there is more than one style property in the list, you need to use a semicolon between each of them to delimit one property from the next. In this example, there are two properties - "color" which sets the color of the text, and "background" which sets the color of the page background. I recommend always adding the semicolon even after the last property.
Colors can be given as names or as numerical values, for instance rgb(255, 204, 204) which is a fleshy pink. The 3 numbers correspond to red, green and blue respectively in the range 0 to 255. You can also use a hexadecimal notation, the same color can also be written as #FFCCCC. More details on color are given in a later section.
Note that the style element must be placed in the document's head along with the title element. It shouldn't be placed within the body.

Linking to a separate style sheet

If you are likely to want to use the same styles for several Web pages it is worth considering using a separate style sheet which you then link from each page. You can do this as follows:
<link type="text/css" rel="stylesheet" href="style.css">
The link tag should be placed within the <head> ... </head> element. Here is an HTML file with a link to an external style sheet:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> replace with your document's title </title>
<link type="text/css" rel="stylesheet" href="style.css">
</head>
<body>

replace with your document's content

</body>
</html>
The link element's rel attribute must be set to the value "stylesheet" to allow the browser to recognize that the href attribute gives the Web address (URL) for your style sheet. A simple stylesheet file might look like the following:
/* style.css - a simple style sheet */
body {
  margin-left: 10%; margin-right: 10%;
  color: black; background: white;
}
Note that the same HTML file can link to an external style sheet and also include a style element for additional style settings specific to this page. If you place the link element before the style element, you can use the latter to override the style settings in the linked style sheet.

Setting the page margins

Web pages look a lot nicer with bigger margins. You can set the left and right margins with the "margin-left" and "margin-right" properties, e.g.
<style type="text/css">
  body { margin-left: 10%; margin-right: 10%; }
</style>
This sets both margins to 10% of the window width, and the margins will scale when you resize the browser window.

Setting left and right indents

To make headings a little more distinctive, you can make them start within the margin set for the body, e.g.
<style type="text/css">
  body { margin-left: 10%; margin-right: 10%; }
  h1 { margin-left: -8%;}
  h2,h3,h4,h5,h6 { margin-left: -4%; }
</style>
This example has three style rules. One for the body, one for h1 (used for the most important headings) and one for the rest of the headings (h2, h3, h4, h5 and h6). The margins for the headings are additive to the margins for the body. Negative values are used to move the start of the headings to the left of the margin set for the body.
In the following sections, the examples of particular style rules will need to be placed within the style element in the document's head (if present) or in a linked style sheet.

Controlling the white space above and below

Browsers do a pretty good job for the white space above and below headings and paragraphs etc. Two reasons for taking control of this yourself are: when you want a lot of white space before a particular heading or paragraph, or when you need precise control for the general spacings.
The "margin-top" property specifies the space above and the "margin-bottom" specifies the space below. To set these for all h2 headings you can write:
h2 { margin-top: 8em; margin-bottom: 3em; }
The em is a very useful unit as it scales with the size of the font. One em is the height of the font. By using em's you can preserve the general look of the Web page independently of the font size. This is much safer than alternatives such as pixels or points, which can cause problems for users who need large fonts to read the text.
Points are commonly used in word processing packages, e.g. 10pt text. Unfortunately the same point size is rendered differently on different browsers. What works fine for one browser will be illegible on another! Sticking with em's avoids these problems.
To specify the space above a particular heading, you should create a named style for the heading. You do this with the class attribute in the markup, e.g.
<h2 class="subsection">Getting started</h2>
The style rule is then written as:
h2.subsection { margin-top: 8em; margin-bottom: 3em; }
The rule starts with the tag name, a dot and then the value of the class attribute. Be careful to avoid placing a space before or after the dot. If you do the rule won't work. There are other ways to set the styles for a particular element but the class attribute is the most flexible.
When a heading is followed by a paragraph, the value for margin-bottom for the heading isn't added to the value for margin-top for the paragraph. Instead, the maximum of the two values is used for the spacing between the heading and paragraph. This subtlety applies to margin-top and margin-bottom regardless of which tags are involved.

First-line indent

Sometimes you may want to indent the first line of each paragraph. The following style rule emulates the traditional way paragraphs are rendered in novels:
p { text-indent: 2em; margin-top: 0; margin-bottom: 0; }
It indents the first line of each paragraph by 2 em's and suppresses the inter-paragraph spacing.

Controlling the font

This section explains how to set the font and size, and how to add italic, bold and other styles.

Font styles

The most common styles are to place text in italic or bold. Most browsers render the em tag in italic and the strong tag in bold. Let's assume you instead want em to appear in bold italic and strong in bold uppercase:
em { font-style: italic; font-weight: bold; }
strong { text-transform: uppercase;  font-weight: bold; }
If you feel so inclined, you can fold headings to lower case as follows:
h2 { text-transform: lowercase; }

Setting the font size

Most browsers use a larger font size for more important headings. If you override the default size, you run the risk of making the text too small to be legible, particularly if you use points. You are therefore recommended to specify font sizes in relative terms.
This example sets heading sizes in percentages relative to the size used for normal text:
h1 { font-size: 200%; }
h2 { font-size: 150%; }
h3 { font-size: 100%; }

Setting the font family

It is likely that your favorite font won't be available on all browsers. To get around this, you are allowed to list several fonts in preference order. There is a short list of generic font names which are guaranteed to be available, so you are recommended to end your list with one of these: serif, sans-serif, cursive, fantasy, or monospace, for instance:
body { font-family: Verdana, sans-serif; }
h1,h2 { font-family: Garamond, "Times New Roman", serif; }
In this example, important headings would preferably be shown in Garamond, failing that in Times New Roman, and if that is unavailable in the browsers default serif font. Paragraph text would appear in Verdana or if that is unavailable in the browser's default sans-serif font.
The legibility of different fonts generally depends more on the height of lower case letters than on the font size itself. Fonts like Verdana are much more legible than ones like "Times New Roman" and are therefore recommended for paragraph text.

Avoid problems with fonts and margins

My first rule is to avoid text at the body level that isn't wrapped in a block level element such as p. For instance:
<h2>Spring in Wiltshire</h2>

Blossom on the trees, bird song and the sound of lambs
bleating in the fields.
The text following the heading runs the risk on some browsers of being rendered with the wrong font and margins. You are therefore advised to enclose all such text in a paragraph, e.g.
<h2>Spring in Wiltshire</h2>

<p>Blossom on the trees, bird song and the sound of lambs
bleating in the fields.</p>
My second rule is to set the font family for pre elements, as some browsers forget to use a fixed pitch font when you set the font size or other properties for pre.
pre { font-family: monospace; }
My third rule is to set the font family on headings, p and ul elements if you intend to set borders or backgrounds on elements such as div. This is a work-around for a bug where the browser forgets to use the inherited font family, instead switching to the default font as set by the browser preferences.
h1,h2,h3,h4,h5,p,ul { font-family: sans-serif; }

Adding borders and backgrounds

You can easily add a border around a heading, list, paragraph or a group of these enclosed with a div element. For instance:
div.box { border: solid; border-width: thin; width: 100%; }
Note that without the "width" property some browsers will place the right margin too far to the right. This can then be used with markup such as:
<div class="box">
The content within this DIV element will be enclosed
in a box with a thin line around it.
</div>
There are a limited choice of border types: dotted, dashed, solid, double, groove, ridge, inset and outset. The border-width property sets the width. Its values include thin, medium and thick as well as a specified width e.g. 0.1em. The border-color property allows you to set the color.
A nice effect is to paint the background of the box with a solid color or with a tiled image. To do this you use the background property. You can fill the box enclosing a div as follows:
div.color {
    background: rgb(204,204,255);
    padding: 0.5em;
    border: none;
  }
Without an explicit definition for border property some browsers will only paint the background color under each character. The padding property introduces some space between the edges of the colored region and the text it contains.
You can set different values for padding on the left, top, right and bottom sides with the padding-left, padding-top, padding-right and padding-bottom properties, e.g. padding-left: 1em.
Suppose you only want borders on some of the sides. You can control the border properties for each of the sides independently using the border-left, border-top, border-right and border-bottom family of properties together with the appropriate suffix: style, width or color, e.g.
p.changed {
    padding-left: 0.2em;
    border-left: solid;
    border-right: none;
    border-top: none;
    border-bottom: none;
    border-left-width: thin;
    border-color: red;
  }
which sets a red border down the left hand side only of any paragraph with the class "changed".

Setting Colors

Some examples for setting colors appeared in earlier sections. Here is a reminder:
body {
    color: black;
    background: white;
  }
  strong { color: red; }
This sets the default to black text on a white background, but renders strong elements in red. There are 16 standard color name, which are explained just below. You can also use decimal values for red, green and blue, where each value appears in the range 0 to 255, e.g. rgb(255, 0, 0) is the same as red. You can also used hex color values which start with the '#' characted followed by six hexadecimal digits. A two-way converter is included below which allows you to convert from RGB to hex color values.

Setting Link Colors

You can use CSS to set the color for hypertext links, with a different color for links that you have yet to follow, ones you have followed, and the active color for when the link is being clicked. You can even set the color for when the mouse pointer is hovering over the link.
:link { color: rgb(0, 0, 153); }  /* for unvisited links */
  :visited { color: rgb(153, 0, 153); } /* for visited links */
  a:active { color: rgb(255, 0, 102); } /* when link is clicked */
  a:hover { color: rgb(0, 96, 255); } /* when mouse is over link */
Sometimes you may want to show hypertext links without them being underlined. You can do this by setting the text-decoration property to none, for example:
a.plain { text-decoration: none; }
Which would suppress underlining for a link such as:
This is <a class="plain" href="what.html">not underlined</a>
Most people when they see underlined text on a Web page, will expect it to be part of a hypertext link. As a result, you are advised to leave underlining on for hypertext links. A similar argument applies to the link colors, most people will interpret underlined blue text as hypertext links. You are advised to leave link colors alone, except when the color of the background would otherwise make the text hard to read.

Color Blindness

When using color, remember that 5 to 10% of men have some form of color blindness. This can cause difficulties distinguishing between red and green, or between yellow and blue. In rare cases, there is an inability to perceive any colors at all. You are recommended to avoid foreground/background color combinations that would make the text hard to read for people with color blindness.

Named colors

The standard set of color names is: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. These 16 colors are defined in HTML 3.2 and 4.01 and correspond to the basic VGA set on PCs. Most browsers accept a wider set of color names but use of these is not recommended.
Color names and sRGB values
black = "#000000" green = "#008000"
silver = "#C0C0C0" lime = "#00FF00"
gray = "#808080" olive = "#808000"
white = "#FFFFFF" yellow = "#FFFF00"
maroon = "#800000" navy = "#000080"
red = "#FF0000" blue = "#0000FF"
purple = "#800080" teal = "#008080"
fuchsia = "#FF00FF" aqua = "#00FFFF"
Thus, the color value "#800080" is the same as "purple".

Hexadecimal color values

Values like "#FF9999" represent colors as hexadecimal numbers for red, green and blue. The first two characters following the # give the number for red, the next two for green and the last two for blue. These numbers are always in the range 0 to 255 decimal. If you know the values in decimal, you can convert to hexadecimal using a calculator, like the one that comes as part of Microsoft Windows.
Enter RGB or Hex value and press appropriate button to convert
red: Hex color value
green:
blue:

Browser safe colors

New computers support thousands or millions of colors, but many older color systems can only show up to 256 colors at a time. To cope with this, these browsers make do with colors from a fixed palette. The effect of this is often visible as a speckling of colors as the browser tries to approximate the true color at any point in the image. This problem will gradually go away as older computers are replaced by newer models.
Most browsers support the same so called "browser safe" palette. This uses 6 evenly spaced gradations in red, green and blue and their combinations. If you select image colors from this palette, you can avoid the speckling effect. This is particularly useful for background areas of images.
If the browser is using the browser safe palette, the page background uses the nearest color in the palette. If you set the page background to a color which isn't in the browser safe palette, you run the risk that the background will have different colors depending on whether the computer is using indexed or true-color.
These are constructed from colors where red, green and blue are restricted to the values:
RGB 00 51 102 153 204 255
Hex 00 33 66 99 CC FF
Here is a table of the browser safe colors and their hex values. My thanks to Bob Stein for this arrangement.
FFF
 FFF
CCC
 CCC
999
 999
666
 666
333
 333
000
 000
FFC
 C00
FF9
 900
FF6
 600
FF3
 300

99C
 C00

CC9
 900
FFC
 C33
FFC
 C66
FF9
 966
FF6
 633
CC3
 300

CC0
 033
CCF
 F00
CCF
 F33
333
 300
666
 600
999
 900
CCC
 C00
FFF
 F00
CC9
 933
CC6
 633
330
 000
660
 000
990
 000
CC0
 000
FF0
 000
FF3
 366
FF0
 033
99F
 F00
CCF
 F66
99C
 C33
666
 633
999
 933
CCC
 C33
FFF
 F33
996
 600
993
 300
663
 333
993
 333
CC3
 333
FF3
 333
CC3
 366
FF6
 699
FF0
 066
66F
 F00
99F
 F66
66C
 C33
669
 900
999
 966
CCC
 C66
FFF
 F66
996
 633
663
 300
996
 666
CC6
 666
FF6
 666
990
 033
CC3
 399
FF6
 6CC
FF0
 099
33F
 F00
66F
 F33
339
 900
66C
 C00
99F
 F33
CCC
 C99
FFF
 F99
CC9
 966
CC6
 600
CC9
 999
FF9
 999
FF3
 399
CC0
 066
990
 066
FF3
 3CC
FF0
 0CC
00C
 C00
33C
 C00
336
 600
669
 933
99C
 C66
CCF
 F99
FFF
 FCC
FFC
 C99
FF9
 933
FFC
 CCC
FF9
 9CC
CC6
 699
993
 366
660
 033
CC0
 099
330
 033
33C
 C33
66C
 C66
00F
 F00
33F
 F33
66F
 F66
99F
 F99
CCF
 FCC

CC9
 9CC
996
 699
993
 399
990
 099
663
 366
660
 066
006
 600
336
 633
009
 900
339
 933
669
 966
99C
 C99

FFC
 CFF
FF9
 9FF
FF6
 6FF
FF3
 3FF
FF0
 0FF
CC6
 6CC
CC3
 3CC
003
 300
00C
 C33
006
 633
339
 966
66C
 C99
99F
 FCC
CCF
 FFF
339
 9FF
99C
 CFF
CCC
 CFF
CC9
 9FF
996
 6CC
663
 399
330
 066
990
 0CC
CC0
 0CC
00F
 F33
33F
 F66
009
 933
00C
 C66
33F
 F99
99F
 FFF
99C
 CCC
006
 6CC
669
 9CC
999
 9FF
999
 9CC
993
 3FF
660
 0CC
660
 099
CC3
 3FF
CC0
 0FF
00F
 F66
66F
 F99
33C
 C66
009
 966
66F
 FFF
66C
 CCC
669
 999
003
 366
336
 699
666
 6FF
666
 6CC
666
 699
330
 099
993
 3CC
CC6
 6FF
990
 0FF
00F
 F99
66F
 FCC
33C
 C99
33F
 FFF
33C
 CCC
339
 999
336
 666
006
 699
003
 399
333
 3FF
333
 3CC
333
 399
333
 366
663
 3CC
996
 6FF
660
 0FF
00F
 FCC
33F
 FCC
00F
 FFF
00C
 CCC
009
 999
006
 666
003
 333
339
 9CC
336
 6CC
000
 0FF
000
 0CC
000
 099
000
 066
000
 033
663
 3FF
330
 0FF
00C
 C99

009
 9CC
33C
 CFF
66C
 CFF
669
 9FF
336
 6FF
003
 3CC

330
 0CC

00C
 CFF
009
 9FF
006
 6FF
003
 3FF

Color swatches for the browser safe palette are available free for many popular graphics packages, from www.visibone.com.

What about browsers that don't support CSS?

Older browsers, that is to say before Netscape 4.0 and Internet Explorer 4.0, either don't support CSS at all or do so inconsistently. For these browsers you can still control the style by using HTML itself.

Setting the color and background

You can set the color using the BODY tag. The following example sets the background color to white and the text color to black:
<body bgcolor="white" text="black">
The BODY element should be placed before the visible content of the Web page, e.g. before the first heading. You can also control the color of hypertext links. There are three attributes for this:
  • link for unvisited links
  • vlink for visited links
  • alink for the color used when you click the link
Here is an example that sets all three:
<body bgcolor="white" text="black"
  link="navy" vlink="maroon" alink="red">
You can also get the browser to tile the page background with an image using the background attribute to specify the Web address for the image, e.g.
<body bgcolor="white" background="texture.jpeg" text="black"
  link="navy" vlink="maroon" alink="red">
It is a good idea to specify a background color using the bgcolor attribute in case the browser is unable to render the image. You should check that the colors you have chosen don't cause legibility problems. As an extreme case consider the following:
<body bgcolor="black">
Most browsers will render text in black by default. The end result is that the page will be shown with black text on a black background! Lots of people suffer from one form of color blindness or another, for example olive green may appear brown to some people.
A separate problem appears when you try to print the Web page. Many browsers will ignore the background color, but will obey the text color. Setting the text to white will often result in a blank page when printed, so the following is not recommended:
<body bgcolor="black" text="white">
You can also use the bgcolor attribute on table cells, e.g.
<table border="0" cellpadding="5">
 <tr>
  <td bgcolor="yellow">colored table cell</td>
 </tr>
</table>
Tables can be used for a variety of layout effects and have been widely exploited for this. In the future this role is likely to be supplanted by style sheets, which make it practical to achieve precise layout with less effort.

Setting the font, its size and color

The FONT tag can be used to select the font, to set its size and the color. This example just sets the color:
This sentence has a <font color="yellow">word</font> in yellow.
The face attribute is used to set the font. It takes a list of fonts in preference order, e.g.
<font face="Garamond, Times New Roman">some text ...</font>
The size attribute can be used to select the font size as a number from 1 to 6. If you place a - or + sign before the number it is interpreted as a relative value. Use size="+1" when you want to use the next larger font size and size="-1" when you want to use the next smaller font size, e.g.
<font size="+1" color="maroon"
  face="Garamond, Times New Roman">some text ...</font>
There are a couple of things you should avoid: Don't choose color combinations that make text hard to read for people who are color blind. Don't use font to make regular text into headings, which should always be marked up using the h1 to h6 tags as appropriate to the importance of the heading.

Getting Further Information

For further information on CSS and tools that support it, you should look at the W3C home page for CSS. This includes pointers to books on HTML and CSS, for example, "Raggett on HTML 4", published 1998 by Addison Wesley. For a more detailed explanation of CSS, "Cascading Style Sheets" by Håkon Wium Lie and Bert Bos, pub. 2005 by Addison Wesley, which provides an in-depth look at CSS as seen by the architects of CSS themselves. Some errata are also available for this book.