Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

CSS3 Borders

CSS3 Borders

A CSS3 Border is such an affords of style sheet which reduces the human efforts of Photoshop and other graphical applications. An individual can create the rounded borders, border shadow, imaged based border and etc. with the help of CSS3 Border.

Basically We use three features to create the border:
  1. border-radius
  2. box-shadow
  3. border-image
border-radius is a such property of CSS3 by which we can create the rounded corners.

box-shadow is a such property of CSS3 by which we can create the shadow of the border.

border-image is a such property of CSS3 by which we can create the customized border, as we can put our own image as a border.


Example


CSS3 Animation

CSS3 Animation

CSS3 animations allows animation of most HTML elements without using JavaScript or Flash!. With this feature of CSS3 You can change the object into one style to another style in an animated way.
The all major browsers support Animation feature except Internet Explorer.

Animation is process of making shape changes and creating motions with elements.

What are CSS3 Animations?

An animation lets an element gradually change from one style to another.

You can change as many CSS properties you want, as many times you want.

To use CSS3 animation, you must first specify some keyframes for the animation.

Keyframes hold what styles the element will have at certain times.

The @keyframes Rule

When you specify CSS styles inside the @keyframes rule, the animation will gradually change from the current style to the new style at certain times.

To get an animation to work, you must bind the animation to an element.

The following example binds the "example" animation to the <div> element. The animation will lasts for 4 seconds, and it will gradually change the background-color of the <div> element from "red" to "yellow":

Example

/* The animation code */
@keyframes example {
    from {background-color: red;}
    to {background-color: yellow;}
}

/* The element to apply the animation to */

div {
    width: 100px;
    height: 100px;
    background-color: red;
    animation-name: example;
    animation-duration: 4s;
}

Note: If the animation-duration property is not specified, the animation will have no effect, because the default value is 0.

In the example above we have specified when the style will change by using the keywords "from" and "to" (which represents 0% (start) and 100% (complete)).

It is also possible to use percent. By using percent, you can add as many style changes as you like.

The following example will change the background-color of the <div> element when the animation is 25% complete, 50% complete, and again when the animation is 100% complete:

Example
/* The animation code */
@keyframes example {
    0%   {background-color: red;}
    25%  {background-color: yellow;}
    50%  {background-color: blue;}
    100% {background-color: green;}
}

/* The element to apply the animation to */

div {
    width: 100px;
    height: 100px;
    background-color: red;
    animation-name: example;
    animation-duration: 4s;
}


The following example will change both the background-color and the position of the <div> element when the animation is 25% complete, 50% complete, and again when the animation is 100% complete:

Example
/* The animation code */
@keyframes example {
    0%   {background-color: red; left:0px; top:0px;}
    25%  {background-color: yellow; left:200px; top:0px;}
    50%  {background-color: blue; left:200px; top:200px;}
    75%  {background-color: green; left:0px; top:200px;}
    100% {background-color: red; left:0px; top:0px;}
}

/* The element to apply the animation to */

div {
    width: 100px;
    height: 100px;
    position: relative;
    background-color: red;
    animation-name: example;
    animation-duration: 4s;
}

Delay an Animation
The animation-delay property specifies a delay for the start of an animation.

The following example has a 2 seconds delay before starting the animation:

Example
div {
    width: 100px;
    height: 100px;
    position: relative;
    background-color: red;
    animation-name: example;
    animation-duration: 4s;
    animation-delay: 2s;
}

Set How Many Times an Animation Should Run
The animation-iteration-count property specifies the number of times an animation should run.

The following example will run the animation 3 times before it stops:

Example
div {
    width: 100px;
    height: 100px;
    position: relative;
    background-color: red;
    animation-name: example;
    animation-duration: 4s;
    animation-iteration-count: 3;
}


CSS3 - Introduction


CSS3 - Introduction

  • CSS3 is the latest standard for CSS.
  • CSS3 is completely backwards-compatible with earlier versions of CSS.
  • This section teaches you about the new features in CSS3!
The main difference between css2 and css3 is follows
- Media Queries
- Namespaces
- Selectors Level 3
- Color

CSS3 modules

CSS3 is collaboration of CSS2 specifications and new specifications, we can called this collaboration is module.Some of the modules are shown below
  • Selectors
  • Box Model
  • Backgrounds
  • Image Values and Replaced Content
  • Text Effects
  • 2D Transformations
  • 3D Transformations
  • Animations
  • Multiple Column Layout
  • User Interface


What is CSS?



What is CSS?

  • CSS stands for Cascading Style Sheets
  • CSS describes how HTML elements are to be displayed on screen, paper, or in other media
  • CSS saves a lot of work. It can control the layout of multiple web pages all at once
  • External stylesheets are stored in CSS files

CSS is short for Cascading Style Sheets, and is the preferred way for setting the look and feel of a website. The style sheets define the colour, size and position of text and other HTML tags, while the HTML files define the content and how it is organised. Separating them allows you to change the colour scheme without having to rewrite your entire web site.

The cascading means that a style applied to a parent element will also apply to all children elements within the parent. For example, setting the colour of body text will mean all headings and paragraphs within the body will also be the same colour.


Why Use CSS?

CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.

CSS Solved a Big Problem

HTML was NEVER intended to contain tags for formatting a web page!

HTML was created to describe the content of a web page, like:

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large websites, where fonts and color information were added to every single page, became a long and expensive process.

To solve this problem, the World Wide Web Consortium (W3C) created CSS.

CSS removed the style formatting from the HTML page!

CSS Saves a Lot of Work!
The style definitions are normally saved in external .css files.

With an external stylesheet file, you can change the look of an entire website by changing just one file!


Inline Styles
Styles defined inline in HTML will only apply to the tag they are added to. Note: colours can be specified as either a CSS colour name or hex colour code.

<p style="color:red;">Some red text</p>


Within the HTML header
A style defined in the header will apply to the whole page. The example below will make all h1 tags in your page show the heading in red.

<head>
<style type="text/css">
 h1 {
   color: red;
 }
</style>
</head>


External CSS file
Like HTML files, CSS files are also plain text, and usually have a .css file extension. An example of a CSS file name style.css can be seen below.

body {
  background-color: beige;
  color: #000080;
}
h1 {
  color: red;
}

The file can then be included using the <link ... > tag in the HTML header.

<head>
<link rel="stylesheet" type="text/css" href="style.css" title="style">
</head>