WordPress versus Joomla

0 comments

Posted on 22nd September 2011 by admin in Misc

When you are looking to create a website, you will probably try some of the content management systems or commonly called CMS. Two of the most popular among them are WordPress and Joomla. In this article I will try to explain some of the major advantages and disadvantages of those systems.

I would like to start with WordPress, which is one of the easiest for use systems available today in the internet. Although, many people think that the WordPress can be used for blogging only, you can easily configure it to work in many other ways. Furthermore, to install that CMS on a server is really easy. That way you will allow people, who do not have any knowledge in web development to create their website for just a couple of hours. Furthermore, you will not have to develop additional scripts to get the comments of other visitors for example, because they are already built in it. On the other hand, WordPress do not provide suitable workspace for developers, because when you try to make some modifications in it, for example to create a shopping cart, the whole system is likely to crash. Furthermore, you will not find proper advice from the WordPress community, because they mainly complain about the features of that system. Finally, when you try to upgrade your existing system, you will usually end up having a lot more bugs than you used to.

Joomla on the other hand is one of the best content management systems for designers, web developers and administrators. That system allows all its users to create great looking websites and also it is really easy for use, by beginners. Furthermore, there are many developers, who create tools, which rapidly improve the performance of Joomla. If you are a developer, you can choose that system, because it offers large capacity for customization and development. Joomla’s features are constantly improving in the past 3 years and so you will enjoy many more features. However, when you take a look at the user interface of that system, you will find that actually is not so easy for use by people, who do not have any idea of web development and also it is far from user friendly. Furthermore, after the recent update of that system to version 1.5.x, there are still many users, who stick to the old one.

 In conclusion, I would like to say that the choice between those systems depends on the purpose of your website and also on your knowledge of web development and design. In addition, when you compare the simplicity of both those systems, you will notice that working with WordPress is a lot easier, so there are many beginners, who choose it instead of Joomla. When you take a particular project, you should check exactly what are the requirements of your client, before you choose any of these content management systems.

Google Search

0 comments

Posted on 15th September 2011 by admin in Internet

Google is the leading search and online advertising company, founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University. Google is so popular that its name has been added to the Oxford English Dictionary—the verb “Google” means to find something on the Internet using the Google search engine. (“google” with a lowercase “g” is a cricket term, whereas “googol” or 10100 is the mathematical term Google was named after.)

Google’s success in search is largely based on its PageRank™algorithm (patented by Stanford University and Larry Page) and its unique infrastructure of servers that uses linked PCs to achieve faster responses and increased scalability at lower costs.19 Estimates on the number of Google servers range from hundreds of thousands to over one million.20 The PageRank algorithm considers the number of links into a web page and the quality of the linking sites (among other factors) to determine the importance of the page. Each inbound link is a vote saying that site is valuable to someone else; however, votes are given different weights depending on the “voter” site’s own value. So, two pages could have the same PageRank even if one has numerous links in from other pages and the other has fewer links in but from pages with higher PageRank. Google search also considers all of the content on the page, its fonts, its headers and the content of neighboring pages.21 Sites with the highest PageRank will appear at the top of the search results.
In addition to its regular search engine, Google offers specialty search engines for images, news, videos, blogs and more. Using Google web services, you can build Google Maps and other Google services into your applications (see Section 1.13, Web Services, Mashups, Widgets and Gadgets).

AdWords, Google’s pay-per-click (PPC) contextual advertising program (launched in 2000), is the company’s main source of revenue. AdWords ads appear next to search results on the Google site (and are related to the search query). Advertisers write their own ads, which are unobtrusive and uniform in appearance—each ad consists of a headline, limited text and a URL. Advertisers bid on search keywords related to their ads and pay
based on the number of users who click on the ads.

AdSense is Google’s advertising program for publishers (sites like http://www.deitel.com that offer content), inspired by Susan Wojcicki, the vice president of product management. (In 1998, Wojcicki rented a spare room in her house to Larry Page and Sergey Brin where they founded Google.)22 AdSense is a fundamental and popular form of websitemonetization, particularly forWeb 2.0 startup companies. Google text ads (as well as banner and rich-media ads) are placed on participating sites with related content. Click-through rates on contextual ads are often higher than on non-contextual ads
because the ads reach people expressing interest in a related topic. As a result, contextual pay-per-click ads generally pay a higher eCPM (effective cost per thousand impressions).

Samsung Galaxy Tab 10.1 banned from sale in Germany

0 comments

Posted on 12th September 2011 by admin in Techno News

Samsung’s Galaxy Tab 10.1 has been blocked from sale in Germany following a  key court ruling against the company.

A German court today banned the sale of the Galaxy Tab 10.1 in its country,  arguing that the device infringed Apple patents. According to the AFP, which  first reported  on the story, judge Johanna Brueckner-Hoffmann said that there is a “clear  impression of similarity” between the iPad and Galaxy Tab 10.1.

As one might expect, Samsung is not pleased with the court’s decision. In an  e-mailed statement to CNET, the company said that it believes the ruling is bad  for German consumers.

“We are disappointed with this ruling and believe it severely limits consumer  choice in Germany,” the company told to CNET. “We also believe that by imposing an  injunction based on this very generic design right, this ruling restricts design  innovation and progress in the industry.”

Germany has quickly become the epicenter of Apple’s battle with Samsung.  Early last month, Apple won  a preliminary injunction against Samsung in a German court that banned the  sale of the Galaxy Tab 10.1 across Europe. In response, Samsung said that it was  surprised by the decision, and had no idea Apple was seeking an injunction.

“The request for injunction was filed with no notice to Samsung, and the  order was issued without any hearing or presentation of evidence from Samsung,”  the company told  CNET in a statement at the time.

A week later, Samsung went back to a Dusseldorf District Court, arguing that  its device should not be banned from sale across Europe. The court agreed  with Samsung’s claim, saying that its only jurisdiction was in Germany. The  Galaxy Tab 10.1 was thus allowed to be sold in Europe, except in Germany.

Late last month, Apple and Samsung went back to German court to argue their  sides once again. Today’s ruling is the result of that hearing.

During the battle with Samsung, Apple has continued to beat the same drum,  arguing that Samsung has engaged in “blatant copying.”

“It’s no coincidence that Samsung’s latest products look a lot like the iPhone and  iPad, from the shape of the hardware to the user interface and even the  packaging,” Apple spokeswoman Kristin Huguet told CNET last month. “This kind of  blatant copying is wrong, and we need to protect Apple’s intellectual property  when companies steal our ideas.”

Apple might be able to use its victory in Germany as a precedent elsewhere  around the world. The company is currently locked in a bitter patent dispute  against Samsung in South Korea, the U.S., and Australia. Earlier this week, Apple  also filed suit against Samsung in Japan, arguing that the company’s Galaxy  S and S II smartphones, as well as the Galaxy Tab 7 tablet, violate its patents.

In Germany, Samsung is ready to respond. The company told  that it plans  to appeal today’s ruling “to ensure that consumer choice in Germany is  restored.”

Michael (Narayani Computers)

0 comments

Posted on 3rd September 2011 by admin in Misc

WinSetupFromUSB_1-0-beta7

Some Linux Commands

0 comments

Posted on 2nd August 2011 by admin in Linux

Linux has more than 650 commands and every command has its own set of options all performing different operations. Going through each and every one of these commands will be a very tedious task. However limiting yourself to only a few of them is never an option. The trick here to learning all these commands, is to categorise them according to their function. By doing this, you will know atleast the basic commands and have some measure of control over the Linux command line.

When you go through these commands, you will be able to perform different function as per your need in the Linux command line.

  • Basic Commands
  • Editor
  • User Account
  • Network Commands
  • Archive Commands
  • Help Commands
  • Package Management Utilities
  • Process Commands

Basic Commands

 

The ‘must’ know commands fall in this category. I have distributed the commands into two sub categories:  Directory commands and File commands.

DirectoryCommands

    • pwd : Print working directory
    • mkdir :  Create directories
    • cd : Change the current directory
    • rmdir   : Remove directories

FileCommands

  • ls : List directory contents
  • rm : Remove files
  • cp : Copy files from a source to the same or different target(s).
  • mv : Move file to different targets.
  • cat : Read one or more files and print them to standard output. If you need to

view  contents of a short file, cat is recommended.

  • cmp: Compare two files byte by byte.
  • wc: Print the number of new lines, words, and bytes in files.
  • du : Estimate disk usage of each file and recursively for directories.
  • find: Search for files in directory hierarchy, e.g. find notes.txt
  • grep: Print lines matching a pattern,e.g. grep –i topic notes.txt (topic is the pattern)
  • sort: Sort lines of text files

Editor

 

Every Linux program is an executable file. For instance, the cp command is provided by the file in /bin/sh which holds the list of machine instructions. Similarly, if you are installing a package , let’s say vsftpd, your focus will be modifying its configuration file , vsftpd.conf present in /etc directory. This is where you will be using editors.

I use ‘Vim’ frequently. It’s an advanced text editor that comes with a more complete feature than the ‘Vi’ text editor. The other text editors are: nano, vi, kate, (KDE Advanced Text Editor), gedit (graphical user interface).

 

e.g.  vim  kamal.c ( vim filename ).

User Account

 

In linux, you can say that using the ‘root’ account is a SuperUser. You will have access to almost each and every file(configuration files, system , text files etc)  with no interruption and restriction.  You need to be very careful while doing work as the root (super user). Therefore, managing user accounts and groups is an essential part of a system administrator.

For example, an organization ABC has three departments: Marketing, Technical and Account, each department having 3-4 employees. The organization demands you to verify the users of marketing,  technical and account departments so that the employees of each group will be able to view his/her own department file.

Given a scenario, if you know how to manage these accounts, you can easily set permissions for the users mentioned above.  If not, these commands are essential for the task.

  • useradd :  for creating user account.

This command can be executed by administrators only. On debian, you should use adduser. For other options like adding expiry date, home directory etc refer man useradd.

  • passwd : for changing user password.

If the user has set password before, he/she will be prompted for the first password whereas superuser is permitted to bypass the step so that forgotten passwords may be changed.

You can find advices on how to choose a strong password on http://en.wikipedia.org/wiki/Password_strength

  • usermod :   modify user accoun.
  • userdel :   delete a user account and related files

This command can be executed by administrators only.

  • groupadd :   create a new group
  • groupdel : delete the group and entries referring to the group
  • groupmod :   modify a group definition on the system
  • chmod :   modify properties for users
  • chown : change file owner and group
  • chgrp :   change group ownership

Network Commands

Linux is predominantly known for its use in servers. In 2009 it held a server market share ranging between 20–40%(source : wikipedia). One should know the commands to check the ip address, download files from the net, get DNS, etc.

wget   : a non-interactive network downloader

Even if a download fails due to a network problem, it will keep retrying until the whole file has been retrieved.   The server will instruct to continue to download from where it  it left off.

$ wget url-for-file

ping  : send ICMP ECHO_REQUEST to network hosts, you will get back ICMP packet if the host responds.  This command is useful when you are in a doubt whether your computer  is connected or not.

$ ping IP or host name

 

hostname  : show or set  the system’s host name

dnsdomainname : show the system’s DNS domain name

netstat : displays the status of ports ie. which ports are open, closed,       waiting for connections. It displays the contents of /proc/net file.

ifconfig : configure a network interface, or to display their current configuration. It is also useful to get the information about IP address, Subnet Mask,set remote IP address , Netmask etc.

ifup : bring a network interface up

ifdown : take a network interface down

Archive Commands

You want to install a package from its source code. You find out that the source code of the package is archived in a file xxx.tar. In this situation, the command-line utility ‘tar’ proves to be a vital resource for you. The ‘tar’ is probably the most popular Linux backup utility. If the ‘tar’ file is compressed with the compression utility like ‘bzip’ or ‘gzip’, the resulting file is the famous ‘tarballs’ which is a common method to deliver software installation archives.

tar : an archiving program designed to store and extract files from an archive known as a tarfile.

Options :

-c : create a new archive

-r : append files to the end of an archive

-t : list the contents of an archive

-u : only append files that are newer than copy in archive

-x : extract files from an archive

-C : change to directory Dir

-j : filter archive through bzip2,  use  to  decompress  .bz2  files.

-v : verbosely list files processed

-f : use  archive  file

-z : filter the archive through gzip

Examples: tar  -xvf  test.tar    ( extract foo.tar to the current location)

tar -xvzf  test.tar.gz  ( extract gzipped test.tar.gz )

tar  -cvf test.tar    foo/ ( compress the contents of foo folder to foo.tar )

Help commands

There are manual pages for almost all the commands of Linux. You can access the manual pages using man command. The man command offers documentation of the command.  If you type:

$ man ls

You will be seeing the manual page of ls with its name, synopsis, description, author, copyright etc. Remember, there is a manual page for the man command itself.

If you desire to have a brief reference of the command, use -help option with the command.  $ ls -help

You can even use info command to have a quick overview of the command.   $ info ls

Remember, that memorizing all the commands in Linux along with all its options is a very difficult job. So memorise the command and options which has frequent usage and leave the rest to the HELP commands.

Package Management Utilities

On RED HAT, SUSE, and many similar Linux distributions, the RPM Package Manager (RPM) format is used. Ubuntu and Debian, however, uses the Debian Pacakge (DEB) format. Therefore, I have categorised it into two, one for RPM and the other for Debian.

For RPM format, the rpm and yum is prefered.

rpm  options  rpm-package-name (use man rpm for further more information) The -q option tells you if a package is already installed, and the -qa option displays a list of all installed packages.

-qa : List all installed RPM applications -qf : Lists applications that own filename -qR : Lists applications on which this application depends -qi : Displays all application information -qd : Lists only documentation files in the application -qc : Lists only configuration files in the application

If you add p qualifier to the above options, gives information about specific package. For e.g. -qpl : Lists files in the RPM package

Yum (Yellowdog Update modifier) -yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. You need to install yum in your Linux system.

yum    command    package-name

e.g. $yum install package-name

Its configuration file is /etc/yum.

For Debian packages, Advanced Package Tool (APT) and Debian Package Tool (dpkg) is preferred.

apt   command   package-name use apt-get install package-name to install a package.

Similarly, if you want to upgrade a package use apt-get upgrade package-name. With no package specified, apt-get with the upgrade command will upgrade your entire system for FTP site, or CD. You can find configuration files in /etc/apt. There are sources.list, apt.conf files to look for.

dpkg(Debian package tool) is another method to install a binary file with the format .deb. To install , type  $dpkg   -i  xxxx.deb

To remove, $dpkg -r xxxx.deb.

 

Process commands

In order to execute a command in the background, place an ampersand(&) on the command line at the end of the command. A user job number(placed in brackets) and a system process number are displayed. A system process number is the number by which the system identifies the job whereas a user job number is the number by which the user identifies the job.

$ sudo cp -rf * ~/ss &

[1]   9144

$

  • jobs : lists the jobs being run at the background

$jobs

[1]-  Running   sudo  cp  -rf  *  ~/ss  &

[2]+  Running   sudo  cp  -rf  *  ~/yy &

  • The ‘+‘ sign indicates the job currently being processed , ‘-’ sign indicates the upcoming jobs to be executed.  The ‘% ‘ used with the job number refrences a job. e.g. Used in fg.
  • fg : a  process running in the background  will be processed in the foreground

$ fg % 2

cat  *.cpp  > mytext

$

  • kill : cancels a job running in the background, it takes argument either the user job number or the system process number.

$jobs

[1]   +  Running    cp  *.c  > mytext

[2]  – Running    cp  *.dat >>mytext

$kill %2

  • bg: places a suspended job in the background

$ cat *.cpp > mytext

^Z

$bg

( Ctrl + Z  will suspend the process running at the moment )

  • ps : reports a snapshot of the current processes
  • top : displays Linux tasks
  • at : executes commands at a specified time.

$ at  8:00

at >  echo “HI” > /dev/tty1

(Press ‘ctrl + d’ to return to the command line. This will display the message in tty1 at 8′o clock.)

  • To view the schedule : $ atq
  • To cancel a job : $atrm 5   [job ID]
  • crontab :crontab  is a file which contains the schedule of  entries to run at  specified times.
  • shutdown: bring the system down
    • -r     Requests  that  the system be rebooted after it has been brought down.
    • -c     Cancels a running shutdown.

Other commands

  • whoami : displays the login name of the current effective user.
  • logname : print user´s login name
  • quota : display disk usage and limits, e.g $ quota -v
  • su : switch to super user or change user ID
  • which : returns the pathnames of the files which would be executed in the current  environment.

Type $which ls, you will get /bin/ls.

CSS Guide

0 comments

Posted on 1st August 2011 by admin in CSS

Ok. Let’s set the record straight. There is no official guide for each and every CSS shorthand property value. So let’s work together and put one together shall we? Ok. Straight to the business. Anytime I’ve ran into a specification (besides the confusing mess at the W3C), it turns into showing off a couple of examples and you’re supposed to be set on your way. Well well. Over the years, I’ve found quite some interesting unknown quirky facts about these shorthands… hence this Guide was born.

Background

Backgrounds can be tricky. Nevertheless, effective when condensed correctly. The syntax for declaring the background shorthand values are
as follows:

background properties

element { background-color: color || #hex || (rgb / % || 0-255); background-image:url(URI); background-repeat: repeat || repeat-x || repeat-y || no-repeat; background-position: X Y || (top||bottom||center) (left||right||center); background-attachment: scroll || fixed; }

Believe it or not, all these properties can be combined into one single backgroundproperty as follows:

the background shorthand property

element { background: #fff url(image.png) no-repeat 20px 100px fixed; }

The Unknown

Often times developers find themselves wondering What if I leave out this value or that one? How will that effect the design?. Good questions.

By default, the background property will assume the following when you do notdeclare each value of the properties.

default background property values

 element { background-color: transparent; background-image: none; background-repeat: repeat; background-position: top left; background-attachment: scroll; }

Lesson learned: be careful on what you don’t
declare. By chosing to not declare a value on a shorthand property, you
are explicitly declaring the above default settings.
For example, let’s look at the following example.

background shorthand example (unexplicit)

element { background:red url(image.png); }

This would be the same as declaring the following values:

background shorthand example (explicit)

element { background:red url(image.png) repeat top left scroll; }

Font

Font is perhaps the trickiest. However, it follows the same rules as the background shorthand property. All that you do not declare will have unexplicit values. Here is the font shorthand specification:

font properties

element { font-style: normal || italic || oblique; font-variant:normal || small-caps; font-weight: normal || bold || bolder || || lighter || (100-900); font-size: (number+unit) || (xx-small - xx-large); line-height: normal || (number+unit); font-family:name,"more names"; }

The default values for the font shorthand property are as follows:

default font property values

element { font-style: normal; font-variant:normal; font-weight: normal; font-size: inherit; line-height: normal; font-family:inherit; }

And of course without any further ado. The font shorthand property syntax:

the font shorthand property

element { font: normal normal normal inhert/ normal inherit; }

Here is where it gets tricky. The fact that font-style, font-variant, and font-weight
all come “normal” out of the box, you may need to pay a little more
close attention when you’re styling elements that come with default
browser styles like <h1> – <h6> or <strong> and
<em>. For example, styling the strong element:

strong element styled with font

strong { font:12px verdana; }

By writing the above into your style sheet, you will be unexplicitly removing the font-weight:bold default browser style that is applied to strong elements.

Last but not least (for -font- that is), a real world example:

font shorthand property example (unexplicit)

p { font:bold 1em/1.2em georgia,"times new roman",serif; }

This would be the same as declaring the following properties:

the font shorthand property (explicit)

p { font-style:normal; font-variant:normal; font-weight:bold; font-size:1em; line-height:1.2em; font-family:georgia,"times new roman",serif; }

Border

Let’s not waste time discussing the warnings. The same rules apply from here on out. This is all you need to know

border properties

element { border-width: number+unit; border-style: (numerous); border-color: color || #hex || (rgb / % || 0-255); }

becomes this:

the border shorthand propertie

element { border: 4px groove linen }

Don’t ask me how that would look. The fact that “linen” is in there,
things could get scary. Nevermind the matter, here is where ‘border’
gets funny.

border examples

p { border:solid blue; } /* will create a '3px' solid blue border... who knows where 3px came from?? */ p { border:5px solid; } /* will create 5px solid 'black' border... default must be black?? */ p { border:dashed; } /* will create a '3px' dashed 'black' border... 3px black lines unite! */ p { border:10px red; } p { border:10px; } p { border:red; } /* these just don't even work */ 

One thing to specially take note about declaring a border without a
color, the default will be ‘black’ unless otherwise noted through an
explicit or inherited ‘color’ property. See the following examples:

border color examples

 p { border:dotted; color:red; } /* will create a 3px dotted red border */ /* ----------------------------- */ body { color:blue; } body p { border:5px solid; } /* will create a 5px solid blue border */ /* ----------------------------- */

Get it? Got it. Good! (isn’t that a song?) Anyway. On with this

Margin and Padding

These are by far the easiest. Just think about the hands of a clock
starting at noon, and follow the hour. For the sake of brevity, we’ll be
working with margin (since it’s a shorter word). So for all cases of
margin, the same rules apply to padding.

margin properties.

element { margin-top: number+unit; margin-right: number+unit; margin-bottom: number+unit; margin-left: number+unit; }

… combined into the margin superpowers:

the margin shorthand property

/* top right bottom left */ element { margin: auto auto auto auto; }

Of course, you may declare your margin with one, two, three, or four values. Here is how each scenario will be played out:

margin fun

/* adds a 10px margin to all four sides */ element { margin:10px; } /* adds a 20px margin to top and bottom and a 5px margin to left and right */ element { margin:20px 5px; } /* adds a 50px margin to top and a 10px margin to left and right and a 300px margin to bottom */ element { margin:50px 10px 300px; } 

Understood? Let’s keep going. This is fun isn’t it! (whatever, you like it).

Outline

Quite frankly, this property has dropped off the existence of the design
radar. Mainly because of lack of browsers supporting this CSS 2.1
standard (yep, it’s an actual property), but nonetheless, it too has a
shorthand property. This property follows the exact same (or same exact -
they mean the same thing) specification as the ‘border’ shorthand
property. But, for purposes of this being a Guide, it must be here. So:

outline properties

element { outline-width: number+unit; outline-style: (numerous); outline-color: color || #hex || (rgb / % || 0-255); }

Outline written as shorthand:

outline shorthand property

element { outline:3px dotted gray; }

For purposes of trying to keep things from repeating, please see the border shorthand sectionon this document to understand the odds, ends, and quirks of the outline property.

List-style

This is it. The last one. It’s rarely used frequently. Hence rarely.
That is why I kept it until the end (sorry, the best was first in my own
opinion). Here is the list-style properties:

list-style properties

element { list-style-type: (numerous); list-style-position:inside || outside; list-style-image:url(image.png); }

Here is the defaults:

list-style property defaults

element { list-style-type:disc; list-style-position:outside; list-style-image:none; }

And for the sake of final brevity. Here is a simple example:

list-style shorthand property example

ul li { list-style:square inside url(image.png); } /* in this particular case if image.png is not available then a square will be provided as secondary */

Uninstalling Program in Linux

0 comments

Posted on 30th July 2011 by admin in Linux

Linux has many ways to install programs. The graphical package manager, RPMs, the Debian package manager, the apt and yum utilities, and compiling directly from source code are the most popular methods. Uninstalling a program depends on the way you installed the application in the first place. In order to complete the process, you must know the way the program was installed and the exact name of the program. The following steps explain the uninstall process and commands for each of the most popular installation methods.

Instructions

  1. Click on the program and choose uninstall in the graphical package manager if the program was installed via the package manager.

  2. Issue the command “rpm -e program_name” if the program was installed via an .rpm file.

  3. Type the command “sudo dpkg -r program_name” if the program was installed via the Debian package manager(.deb).

  4. Enter the command “sudo apt-get remove program_name” if the program was installed from the command line via the apt utility. This command only removes the program while leaving the configuration files behind. If you want to totally remove the program and all of its files, use the command “apt-get –purge remove program_name”.

  5. Issue the command “yum remove program_name” if the program was installed from the command line via the yum utility.

  6. Enter the directory that holds the make files and type “make uninstall” if the program was installed from source code.

What is CSS?

0 comments

Posted on 29th July 2011 by admin in CSS

CSS (cascading stylesheets) is a simple mechanism for controlling the style of a web document without compromising its structure. By separating visual design elements (fonts, colors, margins, and so on) from the structural logic of a web page, CSS gives designers the control they crave without sacrificing the integrity of the data, thus maintaining its usability in multiple environments.

In addition, defining typographic design and page layout from within a single, distinct block of code — without having to resort to image maps, <font> tags, tables, and spacer GIFs — allows for faster downloads, streamlined site maintenance, and instantaneous global control of design attributes across multiple pages.

Client-side support for the various CSS properties is uneven, even among browsers that support stylesheets.

Some Reference for your

  1. How CSS Works
  2. Linking Stylesheets
  3. CSS Units of Measure
  4. CSS Attributes
  5. CSS Properties
  6. CSS Examples

CSS Properties

0 comments

Posted on 29th July 2011 by admin in CSS

Name of
Property
Rule syntax Possible values
font-family <selector> {font-family:<value>} <family-name> (specify) or <generic-family> [serif, sans-serif, cursive, fantasy, monospace]

font-style <selector> {font-style:<value>} normal, italic

font-weight <selector> {font-weight:<value>} normal, bold, 100, 200, 300, 400, 500, 600, 700, 800, 900

font-size <selector> {font-size:<value>} <absolute-size>, <relative-size>, <length>, <percentage>

font $
<selector> {font:<value>} , , ,
Color and Background
Name of
Property
Rule syntax Possible values
color <selector> {color:<value>} <color>

background-color <selector> {background-color:<value>} <color>

background-image <selector> {background-image:url(<value>)} URL (relative or absolute path)

background $
<selector>{background:<value>} <background-color> (i.e., <color>)
Text properties
Name of
Property
Rule syntax Possible values
Text-decoration <selector>{text-decoration:<value>} underline, line-through

text-transform <selector>{text-transform:<value>} capitalize, uppercase, lowercase, none

text-align <selector>{text-align:<value>} left, right, center, justify

text-indent <selector>{text-indent:<value>} <length>, <percentage>
Box properties
Name of
Property
Rule syntax Possible values
margin $ <selector>{margin:<value>} <length>, <percentage>, auto(sequence:t r b l)

margin-top <selector>{margin-top:<value>} <length>, <percentage>, auto

Margin-right <selector>{margin-right:<value>} <length>, <percentage>, auto

margin-bottom <selector>{margin-bottom:<value>} <length>, <percentage>, auto

margin-left <selector>{margin-left:<value>} <length>, <percentage>, auto

padding $
<selector>{padding:<value>} <length>, <percentage>, (sequence:t r b l)

padding-top
<selector>{padding-top:<value>} <length>, <percentage>

padding-right
<selector>{padding-right:<value>} <length>, <percentage>

padding-bottom
<selector>{padding-bottom:<value>} <length>, <percentage>

padding-left
<selector>{padding-left:<value>} <length>, <percentage>

border-color
<selector>{border-color:<value>} <color>

border-style
<selector>{border-style:<value>} solid, double, groove, ridge, inset, outset

border $
<selector>{border:<value>} <border-width>, <border-style>, <color>
Block-level and Replaced Elements
width <selector>{width:<value>} <length>, <percentage>, auto

height <selector>{height:<value>} <length>, auto

float <selector>{float:<value>} left, right

clear <selector>{clear:<value>} none, left, right
Position (CSS – P)
Name of
Property
Rule syntax Possible values
position <selector>{position:<value>} absolute, relative

top <selector>{top:<value>} <length>, <percentage>, auto

left <selector>{left:<value>} <length>, <percentage>, auto

visibility <selector>{visibility:<value>} hidden, visible, inherit

z-index <selector>{z-index:<value>} <number>, auto

overflow <selector>{overflow:<value>} visible, hidden, auto

$ = Shorthand Property

CSS Examples

0 comments

Posted on 29th July 2011 by admin in CSS

Individual Properties
Style rules Comments
p {font-family:Helvetica, Geneva; Of those listed, the first available font will be applied.
font-style:italic; Text will be rendered as italic.
font-weight:bold; Text will be rendered as bold.
font-size:10pt; Text will be rendered as 10-point type.
color:#00FFFF; Text will be rendered to the hex color value #00FFFF.
background-color:blue; The element’s background color will be rendered as blue.
background-image:url(images/foo.gif)} The element will have the background image(s) specified.

.foo {text-decoration:underlined} Text in the class “foo” will be underlined.
{text-transform:lowercase} Text in the class “foo” will be rendered as lowercase.

#foo {text-align:center} Text with the ID “foo” will be center-aligned.
{text-indent:1em} Text with the ID “foo” will be indented 1 em.

p {margin-top:12px; The element’s top margin will be 12 pixels.
margin-bottom:18px; The element’s bottom margin will be 18 pixels.
padding-right:8pt; The element’s right padding will be 8 points.
padding-left:4pt} The element’s left padding will be 4 points.

body {border-color:red; Borders will be red.
border-style:solid} Borders will be solid.
Block-level and replaced elements
img {width:20px; The element’s width will be 20 pixels.
height:40px; The element’s height will be 40 pixels.
float:left} Text will flow to the left of the element.

p {clear:left} Moves the element below a floating element placed on the left.
Shorthand Properties
Style rules Comments
p {font:10pt bold non-serif} Text will be rendered as 10-point bold non-serif type.
{background:black} The element’s background color will be black.
{margin:25px} All of the element’s margins will be 25 pixels.
{margin:20px 10px 20px 10px} Top and bottom margins will be 20 pixels; left and right margins will be 10 pixels.

body {padding:2px} Padding will be 2 pixels on each side.
{padding:8px 4px 8px 4px} Top and bottom padding will be 8 pixels; left and right padding will be 4 pixels.
{border:2px solid red} There will be a red, solid border on all sides of the element.
Position (CSS – P)
Style rules Comments
#foo {position:absolute; top:15pt; left:15pt} The element’s absolute position will be set 15 points from the top and 15 points from the left.
{visibility:hidden} The element’s contents will be hidden.

.foo {z-index:2} The element’s z-index will be two.

p {overflow:visible} The element’s contents will be rendered (visible) even if they exceed its height or width.
{overflow:hidden} The element’s contents will be clipped to its height and width, and no scrolling mechanism will be provided.