Skip to main content

Posts

Showing posts from July, 2014

Three formats of calling css

Call using tag: We can call a css using the tag like below. td { padding: 5px; text-align: left; background-color: #F2F2F2; } Here all the attribute with td tag will be formatted with this css. Call using id: We can call a css using the id like below and the css will be applied to the particular attribute with this particular id. #p1 { background-color: #00FF00; padding: 2px; } Here all the attribute with td id 'p1' will be formatted with this css and while using id we should call id starting with a hash (#). And in html file <div> This call calls using id </div> Call using class: We can call a css using the attribute 'class' like below and the css will be applied to the particular attribute with this particular class attribute. .p1 { background-color: #00FF00; padding: 2px; } Here all the attribute with td id 'p1' will be formatted with this css and while using id we should ...

CSS - Borders

The border properties allow you to specify how the border of the box representing an element should look. There are three properties of a border you can change The border-color Specifies the color of a border. The border-style Specifies whether a border should be solid, dashed line, double line, or one of the other possible values. The border-width Specifies the width of a border. Now we will see how to use these properties with examples. The border-color Property: The border-color property allows you to change the color of the border surrounding an element. You can individually change the color of the bottom, left, top and right sides of an element's border using the properties: border-bottom-color changes the color of bottom border. border-top-color changes the color of top border. border-left-color changes the color of left border. border-right-color changes the color of right border. The border-style Property: The border-style property allows...

Centering Text with CSS

Centering text and other elements can easily be done with the CSS text-align property. Applying this to an internal or external stylesheet: p {text-align: center;} or this to inline styling: This is centered text

Zoom Animation between Activities in Android

Create an activity and call that activity from the main activity as shown below. MainActivity .class import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity { Button Zoombut; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Zoombut = (Button) findViewById(R.id.button1); Zoombut.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { // TODO Auto-generated method stub Intent i = new Intent(MainActivity.this, success.class); startActivity(i); overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit); }}); }} Create a folder in resource and name it as "anim" an create two xmls with the following animation code. Copy and paste the code from below: zoom_...