Saturday, August 13, 2011

How Does CSS Work?

by eturo

In this tutorial you will learn how to make your first style sheet. You will get to know about the basic CSS model and which codes are necessary to use CSS in an HTML document.

Many of the properties used in CSS are similar to those of HTML. Thus, if you are used to use HTML for layout, you will most likely recognize many of the codes. Let us look at a concrete example.

The basic CSS syntax

 

Let's say we want a nice red color as the background of a webpage:
Using HTML we could have done it like this:


body bgcolor="#FF0000"

            
With CSS the same result can be achieved like this:
          
body {background-color: #FF0000;}
          
As you will note, the codes are more or less identical for HTML and CSS. 
The above example also shows you the fundamental CSS model:
 


Each selector can have multiple properties, and each property within that selector can have independent values. The property and value are seperated with a colon and contained within curly brackets. Multiple properties are seperated by a semicolon. Multiple values within a property are seperated by commas, and if an individual value contains more than one word you surround it with quotation marks. As shown below.

body
{
background: #eeeeee;
font-family: "Trebuchet MS", Verdana, Arial, serif;
}

Inheritance

When you nest one element inside another, the nested element will inherit the properties assigned to the containing element. Unless you modify the inner elements values independently.

For example, a font declared in the body will be inherited by all text in the file no matter the containing element, unless you declare another font for a specific nested element.

body {font-family: Verdana, serif;}

Now all text within the (X)HTML file will be set to Verdana.
If you wanted to style certain text with another font, like an h1 or a paragraph then you could do the following.

h1 {font-family: Georgia, sans-serif;}
p {font-family: Tahoma, serif;}

Now all tags within the file will be set to Georgia and all tags are set to Tahoma, leaving text within other elements unchanged from the body declaration of Verdana.

Combining Selectors
You can combine elements within one selector in the following fashion.
h1, h2, h3, h4, h5, h6
{
color: #009900;
font-family: Georgia, sans-serif;
}

Comment tags
Comments can be used to explain why you added certain selectors within your css file. So as to help others who may see your file, or to help you remember what you we're thinking at a later date. You can add comments that will be ignored by browsers in the following manner.
/* This is a comment in CSS*/
                                   
You will note that it begins with a / (forward slash) and than an * (asterisks) then the comment, then the closing tag which is just backward from the opening tag * (asterisks) then the / (forward slash).

In HTML, you can insert comments by using this syntax:

Don't Mock with the Angry Birds!

by eturo


Bookworm. Zuma. FarmVille. Feeding Frenzy. Plants vs Zombies. etc... These were just some of the games I'd love to play for the past few months and years. So what's new with this addictive games. Here are some reviews of these flash and online games.

 


Bookworm is a word-forming computer puzzle game by PopCop games. From a grid of available letters, players connect letters to form words. As words are formed, they are removed from the grid and the remaining letters collapse to fill the available space. As in Scrabble, players earn more points by creating longer words or words which use less common letters.

Zuma is a fast-paced puzzle game developed by also PopCap Games. It can be played for free online at several Web sites, and can be purchased for a number of platforms, including PDAs, mobile phones, and the iPod. The game is set in Aztec Mexico.The objective is to eliminate all of the balls rolling around the screen along a given path, with other balls (the path is clearly visible in all of the levels except the last level), before these balls reach the yellow skull structure, which will open to varying degrees as a warning of oncoming balls. The player can carry two balls at a time and can switch at any time. As soon as one ball reaches the skull, the rest follow and the player loses a life.

Farmville is a farming social network game developed by Zynga. It is a clone of Farm Town, and is similar to older games such as Harvest Moon. Gameplay involving various aspects of farm management such as plowing land, planting, growing and harvesting crops, harvesting trees and bushes, and by raising livestock.

Feeding Frenzy is an arcade-style aquatic game written by Sprout Games, and published by PopCap Games. In this game, players control a hungry marine predator intent on munching as many other fish as possible. During the course of the game's 40 levels, you will switch off between 5 marine animals. The last level is where you attempt to dethrone a large shark, the "Shark King", using Orville the Orca. The player takes on the role of different aquatic species each trying to move up the food chain. As smaller fish are eaten, the player's own fish grows in size and becomes capable of eating somewhat larger fish. By the end of each level, the fish is sufficiently large enough that it can eat almost anything on-screen.

Plants vs. Zombies is a tower defense action video game developed and originally published by PopCap Games for Microsoft Windows and Mac OS X. The game involves a homeowner using many varieties of plants to repel an army of zombies. It was first released on May 5, 2009, and made available on Steam on the same day. In this game, players place different types of plants and fungi, each with their own unique offensive or defensive capabilities, around a house in order to stop a horde of zombies from devouring the brains of the residents.


And now, here it comes these multi-colored angry birds that are attempting to retrieve eggs that have been stolen by a group of evil green pigs.

Angry Birds is a puzzle video game developed by Finland-based Rovio Mobile. Inspired primarily by a sketch of stylized wingless birds, the game was first released for Apple's iOS in December 2009. Since that time, over 12 million copies of the game have been purchased from Apple's App Store, which has prompted the company to design versions for other touchscreen-based smartphones, such as those using the Android operating system, among others.

In the game, players use a slingshot to launch birds at pigs stationed on or within various structures, with the intent of destroying all the pigs on the playfield. As players advance through the game, new birds appear, some with special abilities that can be activated by the player. Rovio Mobile has supported Angry Birds with numerous free updates that add additional game content, and the company has even released stand-alone holiday and promotional versions of the game.

So what are you waiting for, have a copy of this cute angry birds and help them to retrieve their eggs. Once you have it, sit back and enjoy playing.

To download Angy Birds for PC and MacOSX, visit this link. To download more Pop Cap games, get here.

Like Us on Facebook

Related Posts Plugin for WordPress, Blogger...