Setting the Properties of a Container

Blogger Template Design: Tutorial 4

In this tutorial, you'll know the basics of what code sets the properties of a container. To make things simple, we'll look at 2 container blocks only -Main and Post. Once you know these, the basic ideas for all the other containers are pretty much the same.

Here is a sample code for the 2 containers:
#main {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
min-width: 400px;
max-width: 400px;
background: $mainbgColor;
color: #111111;
font: $textFont;
}
.post {
margin: 0px 20px 10px 0px;
padding: 10px 20px 10px 2px;
line-height: 1.5em;
text-align: left;
background: $postbgColor;
}

The #main and .post are the titles of each containers. Each container codes must be contained within {...}. For the explanation below, we'll focus on the codes inside the post block, especially for the explanation on the margin andpadding (the codes colored in red).
  • Margin - sets the distance between the border of the container to the border of a parent (larger) container outside it. There are 4 numbers defining the Margin property. The 1st number sets the top margin, the 2nd sets the right margin, the 3rd number sets the bottom margin, and the 4th number sets the left margin. It basically sets the whole margin in a clock-wise fashion starting from the top. In the case above, the parent container for the post container is the main container. See how the dashed border for the blue (post) container is placed inside the green (main) container following the post block's margin command (the codes in red). If the post's margins are all set to zero, then the postcontainer would be exactly the same size as the main container. Think of the Margin as a command that moves its border away from a parent border. Another thing, Margin can have a negative value, which means that it moves toward the parent border and may overlap it (not away from it).
  • Padding - sets the distance between the border of the container to the border of a child (smaller) container inside it. In the case of the postcontainer, the child container is the post-body. The 4 numbers defining the padding sets the padding in a clock-wise fashion also, just like theMargin property. See how the post's padding puts the post-bodyinside the post container, away from the dashed border. Unlike theMargin, think of the Padding as a command that moves a child border away from its border. Padding values cannot be negative.
  • Min-width and Max-width - sets the width of the container. Usually, it's enough to write it as width = 400px (for example), but it's becoming more of my habit to set the width as strict as possible, because I sometimes saw that if it's not written strictly, the container width might shrink and expand freely on some situations and in some different browsers. So by setting the width strictly, I made sure that it looks exactly like I want at all times in all browsers (basically getting rid of alignment bugs). If you look at my newer templates, I even set the width redundantly, say in Main-wrapper and then in Maincontainers eventhough they are pretty much the same. Doing it this way solves some alignment bugs that I saw (eventhough I don't really understand why it solves it by writing it redundantly).
  • Background - sets the background color of the container. It uses the hexadecimal code for colors. See here for all the color values. You can also set a background image that repeats itself to cover the whole container block. The way to do this is by pointing to the URL of an image. For details on how to do this, see W3Schools tutorials. You can also set the value to be $samplevariable, where the variable is the one that you define in Subsection 1 in CSS Styling Structure.
  • Color - sets the color of your text using the hexadecimal color code, or the variable defined earlier in Subsection 1.
  • Font - sets the font of your text. You can use the variables set inSubsection 1 also. See W3Schools tutorials for more details on setting the font properties.
  • Text-align - sets the alignment of your text. The 3 options are either left, center, or right.
  • Line-height - sets the distance, or height, between two text lines.
My tutorial just gives the basic idea on some of the codes in the Bloggertemplates. I'd say the most important ones for a basic understanding are themargin and padding commands. If you want a more detailed explanation onCSS styling language, I recommend w3Schools CSS Tutorial as a quick and easy resource center.

The Structure of CSS Styling Section

Blogger Template Design: Tutorial 3
In this tutorial, I'll show you the structure of CSS Styling Section, which is the2nd Section in the Blogger Template Code Structure. Again, not all templates have the same structure. It basically comes down to the personal style of a designer. But I've found out the structure that I'll show you is quite logical and makes things a lot easier when coding, debugging, and customizing your template. Once you've understood this tutorial, you can later change the style and structure any way you want. But first you have to understand them and I've put out here a very easy structure to understand and use.

I've cut down the CSS Styling Section into 9 smaller subsections. For now, I'll describe the subsections in general. We'll get to the details on the coding inside these subsections later in the following tutorials. Always refer to theStructure of a Blogger Template to help you understand better the subsections and containers that I explain here.

Subsection 1 - Variable:This subsection contains the declaration (the introduction) of the font and color variables that appear in the Fonts and Colors tab in the Layout page. For example, the Text Color or the Text Font variables that you can choose and modify using the Fonts and Colors tab. In my templates, I've added a lot of variables (close to 40+) compared to some of the standard Bloggertemplates to make it easy for you to customize a lot of things on the template.

Subsection 2 - Global:This part contains the code to control the general appearance and layout. If you look at the green bar above, you'll see the code "body {.....}". This means that every code that goes inside the {.....} will control the general properties (size, layout, & appearance) of the body of the template (everything that the computer screen covers). For example, it controls the width of your whole template and the background color or image. But it doesn't control the detailed properties of the whole template (that is done by all the other subsections). Or, if you do set the detailed properties inside thebody container, say the Text Font, and then reset the same properties inside a smaller sub-container, the properties set in the body container will be overridden, or canceled.

Inside this subsection, you will also find other important large containers - theOuter-wrapper and the Content-wrapper - so this subsection is where you want to look for if you want to tweak those containers.

Subsection 3 - Header:
This part controls the properties of everything inside your Header-wrappercontainer. The most common ones are the Blog Title and the Blog Description. In most of my templates, I've added an extra object in theHeader-wrapper - the Linkbar (or the horizontal menubar). Typically, you can't add extra object in the Header because you can't use the Add Page Element tab. To add the Linkbar, I had to change the 3rd Section of the template code structure (which is the Data section). In my own blog (dzelque.blogspot.com), I added something else, which is the Google Search Bar. Ideally, you can add just about anything you want there, if you know how to deal with the 3rd Section. We'll get to this later.


Subsection 4 - Main:This part controls the properties (size, layout, and appearance) of everything that the Main-wrapper block contains - the Date Header, the Post, theComment, the Feed Link, and any widgets that you drag into the Mainsection using the Add Page Element tab.

Subsection 5 - Sidebar:This part controls the properties of everything inside your Sidebar-wrapper - for example the LabelsBlog ArchiveAdsense units, Link Lists, etc. But, it doesn't set how many sidebars you have or their locations on the blog (example Sidebar-Main-Sidebar or Main-Sidebar-Sidebar). That part is done in the Section 3 of the Blogger Template Code Structure - the Data Section.

Subsection 6 - Miscellaneous:This part controls the properties of additional elements in your blog that's not controlled by all the above subsections. These elements are the Profile (or theAbout Me block), the Blogquote, and the Code. It means if you want to, say, change the color of the quoted text or the font of your nickname in the About Me block, this is where you want to look for to tweak it.

Subsection 7 - Post-Footer:In my Generic Template, this part controls the properties of 3 things:
  1. The Post-Footer - the texts below your post body. This is the part that contains information about your post, or the texts that say "Posted by YourNicknameLabels: .....5 Comments, etc.
  2. The Blog-Pager - the links at the bottom of your blog posts that say "Newer PostsHome, or Older Posts".
  3. The Feed-Link - the link that says "Subscribe to: Posts (Atom)".
Subsection 8 - Comment:This part controls all the properties of the Comments section in your blog.

Subsection 9 - Footer:This part controls all the properties in the Footer section. Generally, theFooter section contains some text explaining the ownership or copyright of a blog. In some other blogs, they also put extra stuff in the Footer section, like the Recent Posts or Popular Posts in 2 or more columns. Basically, you can just put about anything in the Footer as in the Sidebar. But if you want to add more than 1 column to your Footer, you have to tweak the 3rd section of your Blogger Template Code Structure.

Blogger Template Design: Tutorial 2

Here's what the structure of a Blogger template code looks like, in a simple way of looking at it. I'm using my Generic Blogger template as a reference, but the idea is the same for other templates also. I've separated the code in 3 sections and show only the top lines of each section so you can look for the starting lines later on.



Section 1:
The 'header' of the code. Basically it contains important information about the template code and the title of your blog. Best of all, you don't have to worry about anything in this section. It's a standard header for all templates. The only time you add some codes here is when you want to put some meta tags (additional information about your blog for SEO).

Section 2:
This is the CSS Styling SectionCSS stands for Cascading Style Sheets, a web language used to control the style of a HTML document. This is the section that you want to know the most if you want to modify your existing template or design a new template. Eventhough it is a web programming code, you can still do a lot of things on you template design if you understand the structure of this section without knowing much about HTML and CSS. We'll get to this part in more detail later.

Section 3:
This is the Body or Data of the code - the most important part that fetches all your content from Blogger database and puts it in the right place into your blog when somebody is looking at your blog. This is also the section that tells your blog which part comes first - the Header,SidebarsMainPostFooter, etc. But it doesn't set the appearance of the blog and how it would look like on the internet (because that part is controlled by the CSS styling section).

You basically don't have to worry much about this part too, just like the1st Section. But you will have to know a little bit about this section if you want to start adding extra widgets that cannot be put using theAdd Page Element button, like the social bookmarking buttons - Digg,AddThisRSS buttons; or if you want to put Adsense codes in special places like in the Post Page; or putting Google Analytics code to track visitors to your blog; and many other things. Most of the time, there are easy instructions already available to help you add these things in your blog. So, again, nothing much to worry about in this section.

The structure of a Blogger template

Blogger Template Design: Tutorial 1
Before designing a template, you must have an idea of what the basic structure of a template is. Generally, the actual structure of any templates are not exactly the same. But, by knowing the basic structure, you can easily get the ideas of how to tweak your existing templates, design a template, and how to change it into a different structure.

Some parts of the template structure are obvious from what you can see on most blogs: the headers, footers, and posts sections. But there are some sections (I'll call these sections blocks or containers afterward) that are not visible on the computer screen, but important HTML-wise to build a practical and proper working template.

To start off, a template structure basically contains blocks of containers that looks like this:

Going from the biggest to the smallest blocks:
  1. Body: the outer most block is the Body of your template (basically everything that the computer screen covers).
  2. Outer-wrapper: this container covers your whole template (the body is more like the outside of your template). In general, you build a wrapper to place a multiple of smaller blocks inside it. The most common blocks inside this Outer-wrapper is the HeaderContent, andFooter.
  3. Header: this block is the top most part of your blog (the name is quite obvious). But inside the Header you will have other sub-blocks too - the Header Title block, the Header Description block, and others such as the Adsense banners, a menu bar, etc. So, to wrap all these sub-blocks inside one large container, the largest container in the Headersection is usually a Header-wrapper that wraps everything inside.
  4. Content: below the Header is the Content-wrapper - basically the most important container block of all. Immediately inside this wrapper are the Sidebar containers (1,2 or any number of sidebars) and theMain container (which contains your posts, comments, or some ads).
  5. Footer: is the bottom most container of your template. As in theHeader section, you'll also need a Footer-wrapper to contain other sub-blocks in the Footer section.
  6. Main: the Main-wrapper is the outer most container in the Mainsection which goes inside the Content-wrapper. Inside this Main-wrapper are the Post block, Comment block, Date Header, and other widgets created from the Add Page Element option.
  7. Sidebar: is the block that contains all your side widgets - About Me,LabelsArchiveTextHTMLAdsense, etc. In a standard Blogger template, you will usually find only 1 sidebar - hence the 2-column template (Main and Sidebar). But it's actually easy to add multiple number of sidebars. The most common ones are 2 sidebars - or the 3-column template. You will see from these tutorial series that once you understand the template structure, it's actually easy to add and move the sidebars to the left or right of your Main container.
  8. Blog Post: this block contains the important stuff - your Posts Titles,PostPost Author, Labels, etc.
One other way to see this structure is from the hierarchical point of view. Starting from the largest container to its sub-containers, the structure looks like this:
  • Body
    • Outer-wrapper
      • Header-wrapper
        • Blog Title
        • Blog Description
        • Other widgets
      • Content-wrapper
        • Sidebar-wrapper (1,2,3...)
        • Main-wrapper
          • Date Header
          • Posts
            • Post Title
            • Post Content (or called Post Body)
            • Post Footer (Author, Labels, etc)
          • Comments
          • Feed Link
          • Other widgets (mostly ad units)
      • Footer-wrapper
        • Footer text (disclaimer, copyrights, etc)
        • Other widgets
Once you understand this basic structure, it'll be easier to start learning about the structure of the Blogger template code. Learning the code structure is not about learning HTML or CSS, but more about how the template code is organized, which is pretty much like how the container structure is organized. It's surprising that even with little knowledge on web programming, you can customize your template quite a lot just by understanding the basic structure and some CSS language.

More Explanation about the Body Code

Blogger Template Design: Tutorial 9

In this tutorial I'll explain a bit more about some special commands that you'll see in the Body section of the code. Here's the sample code again below:

<body>
<div id='outer-wrapper'><div id='wrap2'>
<!-- skip links for text browsers -->
<span id='skiplinks' style='display:none;'>
<a href='#main'>skip to main </a> |
<a href='#sidebar'>skip to sidebar</a>
</span>
<div id='header-wrapper'>
<b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
<b:widget id='Header1' locked='true' title='Blog Title' type='Header'/>
</b:section>
</div>
<div id='content-wrapper'>
<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>
<div class='sidebar-wrapper'>
<b:section class='sidebar' id='sidebar2' preferred='yes'>
</b:section>
</div>
<!-- spacer for skins that want sidebar and main to be the same height-->
<div class='clear'> </div>
</div> <!-- end content-wrapper -->
<div id='footer-wrapper'>
<b:section class='footer' id='footer'>
<b:widget id='Text1' locked='false' title='Blogger Template | JournalBlue' type='Text'/>
</b:section>
</div>
</div></div> <!-- end outer-wrapper -->
</body>


By default, each container has to be wrapped with the div tag and a b:sectiontag. Each div and b:section is 'named' with an identifier using the id command. The can be further classified into a 'class' using the class command. This identification and classification are useful as a reference when you want to style it later using CSS. In the CSS code, the id command is referred to using the # symbol and the class command is referred to using the . symbol. For example, in the CSS code, you might see #main-wrapper {...} or .sidebar {...} which are the codes to style the main-wrapper and sidebar. You can read further about these identification and classification in w3schools.com

Everything wrapped inside the b:section are the widgets (also called the Page Element). For example, inside the Header is a widget named Header1. Note that this widget contains the code 
maxwidgets='1' showaddelement='no'. The maxwidgets='1' means that the maximum widget the header-wrapper can have is 1 only. That means you can't drag aPage Element and place it below or above the Header. Theshowaddelement='no' means that the Add a Page Element button will not appear in the Header section.

In the main-wrapper, you only have the 
showaddelement='no' code which means that you won't have the Add a Page Element button there, but you can still drag other widgets and place it above or below the Blog Postsinside the main-wrapper.

In the sidebar-wrapper, you have the 
preferred='yes' code. This command will create the Add a Page Element button for you to add widgets. Plus, you won't have any limitations on how many widgets you want to add. As you already know, you can always drag the widget to any other wrapper as long as they don't limit the amount of widgets to be displayed in that wrapper.

In the footer-wrapper, there's no code following the id command. This means that you won't have the Add a Page Element button but you can drag any widgets into the Footer section.

How to Advertise With a Banner on the Top of a Blogger Header

Step 1
Visit the Blogger website. Sign in to the website with your Google email and password.
Step 2
Click the name of the blog you wish to edit on your Blogger account page.
Step 3
Click the "Template" button on the left-hand side of your Blogger page. Click "Backup/Restore template followed by "Download full template." Directly below this command is a place to upload this backup copy of your current template in case an error occurs during the blog customization.
Step 4
Click "Edit template." Check the "Expand widget templates" button to ensure all of your blog's code is visible. The page will recycle to show the previously hidden features.
Step 5
Click the "Settings" tab in your web browser and then the "Find" button. An exception is Internet Explorer which requires you to click "Settings" followed by "File" and "Find on this page." Alternatively, hold down the "Ctrl" button and tap the "F" key on your keyboard to bring up a search box.
Step 6
Search for <b:section class='header' id='header' maxwidgets='1' showaddelement='no'><b:widget id='Header1' locked='true' title='Yourheader (Header)' type='Header'>. Alternatively, search for the individual elements of "header," "showaddelement," and "locked=" without the quotation marks. This may be necessary if you have previously altered portions of the header code.
Step 7
Change the "maxwidgets" number from "1" to "2" while also changing "showaddelement" to yes and "locked:'true'" to "false'". Your new code should look like this:
<b:section class='header' id='header' maxwidgets='2' showaddelement='yes'><b:widget id='Header1' locked='false' title='Yourheader (Header)' type='Header'>
Step 8
Click "Preview" to ensure you did not inadvertently alter code elsewhere that could affect your blog display. You will not see your changes until an ad unit is placed inside the created gadget space. Click "Save template" if you are satisfied with the preview image.
Step 9
Click "Layout" in the main blogger menu on the left-hand side of your current webpage. A new gadget area is now located above your header with the words "Add a gadget" displayed across the front.
Step 10
Click "Add a gadget" in the area above your header. Click "Html/JavaScript."
Step 11
Copy and paste in the ad code provided by your affiliate marketer or ad sponsor. The provided links contain tracking codes to ensure you are properly credited for referral sales, so avoid editing this code. Click "Save."
Step 12

Click "Add a gadget" followed by "AdSense" if you prefer to add a Google Adsense banner to your new gadget instead of an affiliate ad. Select your preferred ad-unit size and click "Save."

MARQUEE-Scrolling text and link hacks






Log in to Blogger, go to Layout ->Add a Gadget of HTML/JavaScript type. 


shwenagar.blogspot.com


Here is the code to add a simple scrolling text from right to left side




<marquee>code to simple scrolling text</marquee>


The output:.....

shwenagar.blogspot.com your link shwenagar.blogspot.com google code to simple scrolling text shwenagar.blogspot.com


    your link  shwenagar.blogspot.com  google

  

Malaysia online radio ကို website /blog တြင္ထည္ ့ သြင္းရန္



Malaysia online radio ကို website /blog တြင္ထည္ ့သြင္းရန္

Layout  -  Html / javascript တြင္ ေအာက္ေဖာ္ျပပါ code မ်ားထည့္သြင္း ေပးလိုက္ပါ

<div class="widget-content">
<script type="text/javascript" src="http://www.museter.com/mrp.js"></script>
<script type="text/javascript">
MRP.insert({
'url':'http://119.81.46.217:24086/;',
'codec':'mp3',
'volume':65,
'autoplay':true,
'buffering':5,
'title':'Online Radio(Malaysia)',
'welcome':'Free Online Radio Media (Malaysia News)',
'bgcolor':'#FFFFFF',
'skin':'radiovoz',
'width':220,
'height':69
});
</script><object id="MRPObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="#FFFFFF" height="69" width="220"><param name="movie" value="http://www.museter.com/ffmp3.swf" /><param name="flashvars" value="url=http://119.81.46.217:24086/;&amp;lang=auto&amp;codec=mp3&amp;tracking=true&amp;volume=65&amp;autoplay=true&amp;buffering=5&amp;skin=http://www.museter.com/skins/radiovoz/ffmp3-radiovoz.xml&amp;title=Online Radio(Malaysia)&amp;welcome=Free Online Radio Media (Malaysia News)" /><param name="wmode" value="window" /><param name="allowScriptAccess" value="always" /><param name="scale" value="noscale" /><param name="bgcolor" value="#FFFFFF" /> </object>

</div>

How to Save Flash Files

Steps

  1. 1
    Visit the website for the Adobe Flash Player and install the latest version of the player onto your computer.

  2. 2
    Visit the website which has the flash file or video you would like to save onto your computer.

  3. 3
    Locate the "Tools" menu option on the top menu bar of your internet browser, then click it to highlight its menu options.

  4. 4
    Find the menu option that says "Page Info/View Source" and click on that menu option.

  5. 5
    Locate the flash file from the list of page elements you are wishing to save to your computer.

    • The flash file should have a file extension of .swf on the end of its file name.
  6. 6
    Click the "Save As" button, which is located at the bottom right of the window in order to save the selected flash file to your computer's hard drive.

  7. 7
    Choose the destination where you would like to save the flash file to your computer once the window appears.

  8. 8
    Give the flash file a name that you will remember in order to find it later.
    • The flash file should already have a name given to it, but you now have the option to alter the file's name if you choose to do so.

  9. 9
    Click the "Save" button on the window once you have chosen the proper location in which you wanted to save the file and the window will close.
    • The flash file is now saved to your computer's hard drive in a specific location chosen by you.