css « Intelligrape Groovy & Grails Blogs

Posts Tagged ‘ css ’

canvas

Tuesday, September 7th, 2010
Posted by umar

The HTML <canvas> tag is used for creating graphics on the fly. It can be used for rendering graphs, game graphics, or other visual images.

 

To draw on the canvas, the <canvas> tag is used in conjunction with the getContext(contextId) method.

 

Any content between the <canvas></canvas> tags is “fallback content”- meaning, it will be displayed only if the canvas cannot be displayed.

 

As a script:

function displayCanvas()
	{
      var canvas = document.getElementById("myCanvas");
      if (canvas.getContext) {
        var ctx = canvas.getContext("2d");

        ctx.fillStyle = "rgb(200,0,0)";
        ctx.fillRect (0, 0, 150, 75);

        ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
        ctx.fillRect (40, 30, 125, 75);

        ctx.fillStyle = "rgb(0,0,150)";
        ctx.strokeRect (20, 20, 50, 100);
      }
    }

 

and this is html

<canvas id="myCanvas" width="300" height="200">Your browser does not support the canvas tag. At the time of writing, Firefox, Opera, and Chrome support this tag.

Here's an image of what it's supposed to look like image.
</canvas>

Attributes
width: {Specifies the canvas width in pixels. The default value is 300.Possible values:[Non-negative integer] (for example, 300)}
Height: {Specifies the canvas height in pixels. The default value is 150.Possible values:[Non-negative integer] (for example, 150)}

  • Share/Bookmark
Posted in HTML-UI-CSS

Accessing remote fonts on Client’s system by @font-face

Monday, June 7th, 2010
Posted by umar

@font-face allows authors to specify online fonts to display text on their web pages. By allowing authors to provide their own fonts.

We Use it

I.We choose  font and  we have right now. First of all  font format generate four another format as like(ttf, eot,otf,svg,woff)

and upload server where we access.

II. Create in css This Syntex

@font-face {
font-family: 'PalatinoRegular';
 src: url('palatino-webfont.eot');
 src: local('Palatino'), local('Palatino'),
url('palatino-webfont.woff') format('woff'),
url('palatino-webfont.ttf') format('truetype'),
 url('palatino-webfont.svg#webfontoXFrZcNP') format('svg');
font-weight: normal;
font-style: normal;
}

III. We acces in html page as class or Id and define body tag font-family

Values

<a-remote-font-name>

Specifies a font name that will be used as font face value for font properties.

<source>

URL for the remote font file location, or the name of a font on the user’s computer in the form local("Font Name").

<weight>

A Font-weight value.

You can specify a font on the user’s local computer by name using the local() syntax. If that font isn’t found, other sources will be tried until one is found.
Note:
When not avaible font local machine . This time  @font- face download fonts in browser temporary download font and display text

Supported font formats

  • Internet Explorer (all versions): EOT
  • Safari (3.2+): TTF / OTF
  • iPhone (3.1) SVG
  • Chrome (all versions): SVG (TTF/OTF added 25th Jan 2010)
  • Firefox (3.5+): TTF/OTF (.WOFF added 3.6)
  • Opera (10+) TTF/OTF

Browser compatibility

Browser Lowest version Support of
Internet Explorer 4.0 Embedded OpenType fonts only
Firefox (Gecko) 3.5 (1.9.1) TrueType and OpenType fonts only
3.6 (1.9.2) Web Open Font Format (WOFF)
Opera 10.0 TrueType and OpenType fonts only
Safari (WebKit) 3.1 (525) TrueType and OpenType fonts only

## Umar Pahat##
umar@intelligrape.com
www.IntelliGrape.com

  • Share/Bookmark
Posted in HTML-UI-CSS

IE 6/7 Z-index issue

Thursday, June 3rd, 2010
Posted by Hitesh Bhatia

Recently I got struck in an IE issue … Z-index did not seem to work on IE 6 or 7 ..
After some surfing found a pretty easy solution .
i.e use

position:relative

with z-index ..and voila it works

_____________________
Hitesh Bhatia
hitesh@intelligrape.com
_____________________

  • Share/Bookmark
Posted in HTML-UI-CSS