Saturday, 22 March 2014

What is the difference between padding and margins?

For those who would like to know more about HTML and CSS, in this post we will learn the differences between margin and padding CSS properties that are used to add space between the HTML elements, thus preventing the elements from getting 'stuck' together.

Although both have similar functions, each work in a different way.
  1. Padding determines the inner margins, being used for changing the distance between the content of a given element and its border.
  2. Margin is the space outside of an element affecting how far the element is away from other elements.
For a better understanding of how the padding and margin work, take a look at the picture below:

padding and margin, css proprieties
Difference between margin and padding

Just as you have the option to define the borders for each side of your HTML elements (eg. borders for the sidebar), you can do the same with the margin and padding properties. All you need to to do is to change the top, right, bottom and left values​​.

The values that you can use include: pixels (px), centimeters (cm), millimeters (mm). em units (em), x-height (ex), inches (in), picas (pc) and point sizes (pt).

When using margin and padding, you need to add a value for each 4 corners of an element, as follows: top, right, bottom, left. Each value must refer to the each side of the HTML element. The first value is for the top, and they follow a clockwise direction, so the value would be close to the right, then bottom, and finally, left.

Example 1:
padding:5px 15px 5px 15px;
  • top padding is of 5px 
  • right padding is of 15px 
  • bottom padding is of 5px 
  • left padding is of 15px
margin: 10px 5px 10px 5px;
  • top margin is of 10px
  • right margin is of 5px
  • bottom margin is of 10px
  • left margin is of 5px
If you define a single value (instead of 4), the distance applies on the all sides, i.e. it will be applied on the 4 sides of the HTML element that you want to modify.

Example 2:
padding: 5px (top and bottom) 15px (left and right);
margin: 10px (top and bottom) 5px (left and right);

If it helps you visually, think of an A4 page of type inside a picture frame. The margin is the space between the edge of the sheet of paper and the other elements (the parts of the frame), while the padding would be the space between the edge of the sheet and where the type starts on the page. The border would be the edge of the sheet of paper.

It's probably easier to understand if you have borders, then it also becomes obvious which one to use. Do you want "space" after the border (outside the element = margin) or before the border (inside the element = padding).

Friday, 21 March 2014

Solution for "Rich snippets not showing"

Rich snippets not showing
During my microdata coding i quite accidentally realized, that "rich snippets are not showing" doesn't always mean "rich snippets not working"! My research was about nesting and inheritance of Schema.org's classes, and, playing with the Google's structured data testing tool, i detected a case where my microdata markup was correctly validated and worked properly, but rich snippets of this code weren't showing. After some tests i got to know about two causes of not shown rich snippets:
Read full article »

Authorship markup: how to combine correctly several kinds of it?

Yes, exactly, how to correctly combine them? More: why is it useful and needful to use several authorship markup and whether it produces any SEO-profit?

Some SEOs dispute about differences of using author and publisher properties, another SEOs advice to use only rel="author"... I say: use all you might use simultaneously! (it's needless to say, don't use something, what doesn't fit your context and could be ranked as e.g. rich snippets spam etc ).
Read full article »

How to use Picasa-web-albums with your Google+ Page's photos

This article shows how to manage your Google+ Page's photo collection using Picasa-web-albums.



Recently I described how to always use Picasa-web-albums, rather than Google+ photos, to work with the images that are stored in your Google account.

One issue was that there was no way to use PWA to work with the photo's uploaded to a Google+ Page, rather than an individual Google+ profile.

And this was highlighted when Google introduced an auto-enhancement feature which could be disabled using Picasa-web-albums, but not using Google+ Photos.

However a new feature introduced to Google+ Pages means that you can work around this.


How to access Google+ Page photo albums using Picasa-web-albums

Set up a separate password for your Google+ Page..

Log out of Google / Blogger / Picasa-web-albums (if you log out of one, you are generally removed from the others too).

Log back in again, but this time using your newly created Google+ Page account.

Point your web-browser to Picasa-web-albums, using the do-not-re-direct address:   https://picasaweb.google.com/lh/myphotos?noredirect=1



Job Done!    

You can now use Picasa-web-albums  like normal, including access to features like:

And of course you still have access to the Google+ Photos features, like editing pictures without changing their URL.


Disadvantages / Issues

There's always one!

In this case, it's that you need to be logged into Google using a different account from the one that's the underlying Page owner.   You can use any of the other Google tools   (Maps, Blogger, probably even AdSense) - but it will be with the Google account that was created for your page, rather than with your personal account.

And if you manage multiple pages, you will need to think carefully about exactly how each one is set up, and what account you need to use to work with it.




Related Articles

Understanding Picasa and Picasa-web-albums

Editing photos on-line using Google+ Photos

How to set up a separate password for your Google+ Page

Stop Google from auto-enhancing your images

Sharing photos from your Google+ Photos albums outside of Google+

Thursday, 20 March 2014

How to give a Google+ page its own password and login-name

This article is about setting up a Google+ page so that it is a stand-alone thing, and can log in to Google services without needing your personal Google+ profile.



When Google first introduced Google+ pages, they were totally linked to a Google+ personal profile.

Now, however, you can turn them into stand-alone entitles by giving them a separate login-id (chosen by Google) and password (chosen by you).

This means you can share your Google+ page with other people (eg employees, committee members), without either giving them your Google account password or forcing them to sign up for Google+ themselves.

This is a significant advantage of Google+ over Facebook


How to set up a separate password for a Google+ page


Firstly, set up the Google+ page, using an existing Google+ personal account (aka Google+ profile).


If you have logged out since, then log in to your Google account again (by logging into any one of Adsense, Gmail, Blogger, etc, or just by logging in to Google+).


In the top left corner, choose Pages from the Google+ menu.





In the list of pages that is shown, navigate to the Page that you want to work on, and click Manage this Page.   This opens the Dashboard for your page.


In the top right corner, click the Google+ Page icon.   This used to look like gear-wheel, but now (for me anyway) is a small circle with some of the Page's logo on it.

Choose Settings in the menu box.  





When the settings page opens, scroll down until you find the Third-Party Tools.   Underneath it, click Set a Password.


You may be asked to re-enter your own Google account password, just to double-check that you are you.


The Google Plus Page password assignment screen will open:



Enter and re-enter the password that you want to use, and click Confirm.


You will then see a confirmation page, telling you that
You've set a username and password for [your page]

And you will get an email telling you that:
Your Google+ page [page-name] now has a username (geeky-name-for-your-page-nnnn@pages.plusgoogle.com) and password.


Job done!

You can now log out of your personal Google+ account, and log in to use your Google+ page using its own account, rather than yours.


Who will get notifications about the page?

Google's confirmation page says that they will
...send notifications and other communication about this page to [the email address of the Google+ account that set up the page]. This page’s username can’t be used to send and receive email.

How to change the password

Other important information in the page-password confirmation email includes how to change the password, and what to do if it wasn't you who set the password.

The links provided are customized, so I'm not going to just copy-and-paste them from my own email.   But hopefully I will work out the generic versions and past them here soon.




Related Articles:


Understanding Google accounts  (this article is currently out of age, focussing on Blogger vs Google Classic)

Google+ now has pages

How to set up a Google+ profile for an existing Blogger account