Please Note that I have changed address
Go to
Baking Ways / Productive Bytes



Search This Blog

Pages

Showing posts with label blogspot. Show all posts
Showing posts with label blogspot. Show all posts

Tuesday, April 13, 2010

HTML, CSS, Java script comments

While working on this blog, I have realized that there are at lest three different ways to insert a comment on a HTML web page.

1) HTML comments
<!--This is a comment. Comments are not displayed in the browser-->

The tricky part was to find out how to visualize this comment on the webpage, something that is not supposed to show-up! . The solutions comes down to this table

ResultDescriptionEntity NameEntity Number
non-breaking space&nbsp;&#160;
<less than&lt;&#60;
>greater than&gt;&#62;
&ampersand&amp;&#38;
¢cent&cent;&#162;
£pound&pound;&#163;
¥yen&yen;&#165;
euro&euro;&#8364;
§section&sect;&#167;
©copyright&copy;&#169;
®registered trademark&reg;&#174;

As per above table, the HTML code necessary to show up HTML comments is

&lt;!-- This is a comment. Comments are not displayed in the browser --&gt;

Now the problem is- How do we visualize &lt; ?
In this case we just need to write in the HTML source page:
&amp;lt;



2) CSS comment
    /*  comment here */
3) Java script comment
    // Comment here

Here you can find few examples from my HTML template page

The Jave script is commented becasue is delimited by <!--    -->
Whithin the Jave script code you can find additional comments  //
In the CSS body element, you can find CSS comments /*   */

<-- 

 <script src='http://www.mathjax.org/MathJax/MathJax.js' type='text/javascript'>  //
  //  This script call is what gets MathJax loaded and running
  //
  MathJax.Hub.Config({
    jax: ["input/TeX","output/HTML-CSS"],    // input is TeX and output is HTML-CSS format
    extensions: ["tex2jax.js"],              // use the tex2jax preprocessor
    tex2jax: {
//    inlineMath: [['$','$'],['\\(','\\)']], // uncomment to use $...$ for inline math
      processEscapes: 1                      // set to 1 to allow \$ to produce a dollar sign
    }
  });


-->

body {

/*  background:$bgcolor; */ /* old code */
  background:#d0e4fe; /* new code */
  margin:0;
  color:$textcolor;
  font:x-small Georgia Serif;
  font-size/* */:/**/small;
  font-size: /**/small;
  text-align: center;
  }

Sunday, April 11, 2010

How to customize blogspot

Thanks to a very good friend of mine, Claudio Corsetti, I managed to make some changes to my blog layout

1) To make the main column wider just do this
#outer-wrapper { width: 1000px;}
#main-wrapper { width: 750px;}
#sidebar-wrapper { width: 220px;}

The main-wrapper width added to the sidebar-wrapper one should always be less than the outer-wrapper width.
I made the out-wrapper width to be 1000px taking in to account that most of the current screen are more than 1000px wide


2) To justify the text of the main wrapper
#main-wrapper {text-align:justify;}

3) If you want to add formulas using images, this setting comes useful, it controls their vertical align

.post img, table.tr-caption-container {
vertical-align: -50%;
}

Note that for this blog I will not be using images for formulas but the MathML standard.

4) To make the main column background-colour different from the main page one, we need to change the css body element

With this instruction I change page background color
body { background: #d0e4fe; }

5) the code here makes the outer-wrapper colour adjustable through the custom Layout web interface
#outer-wrapper { background:$bgcolor;}

 
CSS Excerpt
-----------------------------------------------------------------------------------------------

body {
background:$bgcolor;
background:#d0e4fe;
margin:0;
color:$textcolor;
font:x-small Georgia Serif;
font-size/* */:/**/small;
font-size: /**/small;
text-align: center;
}

#outer-wrapper {

  background:$bgcolor; 
  width: 1000px;
  margin:0 auto;
  padding:10px;
  text-align:$startSide;
  font: $bodyfont;

  }

#main-wrapper {
width: 750px;
float: $startSide;
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 */
text-align:justify;
}

#sidebar-wrapper {
width: 220px;
float: $endSide;
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 */
}


.post img, table.tr-caption-container {
padding:4px;
border:1px solid $bordercolor;
vertical-align: -50%;
}