Saturday, February 13, 2010

CSS BACKGROUND OPACITY

CSS (Cascading style sheets) is a language used to describe look and formatting of HTML documents. CSS is designed to be used to separate document content and document formatting. The most common use of CSS is to style the web pages written in HTML and XHTML.
There are various levels and profiles of CSS. Each level of CSS is an incremental release, which adds new features and is denoted as CSS1, CSS2, and CSS3. The profiles are mainly a division of one or more levels of CSS developed for a particular device or user interface. Presently there are profiles for printers, mobile devices and television sets.

The CSS syntax consists of three parts:
• A selector
• A property
• A value
Example: selector {property: value}

What is CSS Background opacity?
One of the things that can be done with no difficulty in print design, but not on the Web is superimposing text on an image or colored background, and changing the transparency of that image so that the text fades into the background. The problem can be solved with help of CSS Background opacity which has a property in CSS 3 that will allow you to change the opacity of your elements so that they fade in and out.
The opacity property takes a value of the amount of transparency from 0.0 to 1.0. 0.0 is 100% transparent - anything below that element will show completely through. 1.0 is 100% opaque - nothing below the element will show through.
So to set an element to 50% transparent, you would write: opacity: 0.5;
A few points to remember about CSS Background opacity is:

• Neither Internet Explorer v6 nor v7 support the CSS 3 opacity property. Instead, IE supports a Microsoft-only property "alpha filter". Alpha filters in IE accept values from 0 (completely transparent) to 100 (completely opaque). So, to get your transparency in IE, you should multiply your opacity by 100 and add an alpha filter to your styles:
filter: alpha(opacity=50);

• For some older Mozilla browsers you need to use the property "-moz-opacity" to change the transparency. It works the same as the CSS 3 property.
-moz-opacity:0.5;
• You can also make Images transparent too by setting the opacity on the image itself and it will fade into the background. This is really useful for background images.
Here is an example for CSS Background Opacity in Action

A)



B)


Note: You can notice the difference in the code between the first row, which uses the same color value for each row, combined with an opacity value, and the second, which uses RGB values: maintained by safari3, firefox3, chrome not hereditary, on results on child elements not able to be applied to images. Although RGBA is not supported by the browser, employs previous colour values or defaults. It is extremely a development enhancement or a needed feature. The opacity property is just as well hardly difficult for complex plan, but enormous for single element.

Friday, February 12, 2010

CSS Background Position

The CSS background position is nothing but how we change a background of we gage using CSS. The full form of CSS means cascading style sheets. The main purpose of using CSS means we can set different fonts, colors to the page for example if we want to change
The background as black color we should write the code as below
body
{
background-color=”black”;
}
In this way if we want to change background image it should be written as shown below
body
{
background-image=”child.jpg”;
}
In this way we can change background using following properties
top left;
top right;
center right;
center left;
center top;
center bottom;
bottom left;
bottom right;
x position,y position;
inherit: which specigies that the positions of x and y are inherited from the parent element;
Syntax: background position :< value>
value:% value [center|top|bottom][right|left|center]
appiles to:block level and replaced elements
The background property value gives the initial poison of background image.
For example the below code will explain the usage of background positioning using cascading style sheets.
body
{
background-color=”red”;
}

The usage of cascading style sheets </title. <br /><h1> the example of the background color cascading style sheets </h1> <br /><body> <br /><h2> the usage is very lot of cascading style sheets when we use them as background </h2> <br /><h3> this is an example of cascading style sheets </h3> <br /><h4> we have different properties to be used <h4> <br /><h5> we can make web page as we want to change </h5> <br /><h6> this is the main usage of cascading style sheets </h6> <br /></body> <br /></html> <br />The above program will give the out put as like below <br />the example of background color using cascading style sheets <br />The example of body background color using cascading style sheets <br />the usage is very lot of cascading style sheets when we use them for background changing <br />This is an example of using cascading style sheets we have different properties to be used <br />we can make web pages as went to change <br />this is the main usage of cascading style sheets <br />The easiest way to assign background position is with keywords <br />Horizontal keywords ( left center right ); <br />Vertical keywords ( top center bottom ); <br />we can change the height and width of an image by mentioning them with values <br />If we give beyond the values it will lead to appear the image ugly <br />the background position will give the intial position of the image we can change that bye <br />using cascading style sheets <br />syntax: background-repeat; <br />The above syntax will be used to repeat the image as how many wants we want to change <br />now let me explain the above property with an example <br />body <br />{ <br />background-repeat (“6”); <br />} <br />This is the main functionality of the background repeat which leads to repeat an image <br />6 times <br />now let me explain this by writing html code <br /><html> <br /><title> the example of background repeat

the background repeat will permit us to repeat the background as how many wants to repeat as we want






This is very easy for CSS background-position you can just add the image to the background. Which types of image add you web page, you have to look at construct page of area and then put the image considering both horizontally and vertical.