CSS: Drop Caps

Mar 03

CSS: Drop Caps

CSS: Drop Caps

Use the first-letter Pseudo-Class

The easiest way to create CSS Drop Caps is to use the first-letter pseudo-element on the element you want to have a drop cap. The problem is, this isn’t supported in all browsers. Be sure to test this in the browsers your Web site supports.

Type the following and place it in a

element at the top of your Web page:

Read More

CSS: How to Create Multiple Borders in CSS3

Feb 03

CSS: How to Create Multiple Borders in CSS3

CSS: How to Create Multiple Borders in CSS3


A cool technique using the box-shadow property that allows you to create multiple borders around an object.

box-shadow:
    0 0 0 2px #000,
    0 0 0 3px #999,
    0 0 0 9px #fa0,
    0 0 0 10px #666,
    0 0 0 16px #fd0,
    0 0 0 18px #000;
Read More

Override Inline Styles with CSS

Aug 17

Thank our lucky stars, we CAN override inline styles directly from the stylesheet. Take this example markup:

<div style="background: red;">
    The inline styles for this div should make it red.
</div>

We can fight that with this:

div[style] {
   background: yellow !important;
}
Read More

Change image Opacity on mouse hover

Jul 13

div.block-banners img {
    opacity: 0.9;
    filter:alpha(opacity=90);/******* This line for IE ********/
}
div.block-banners img:hover {
    opacity: 1;
    filter:alpha(opacity=100);/******* This line for IE ********/
}
Read More

HTML iframe frameborder Attribute

Jun 01

Definition and Usage
The frameborder attribute specifies whether or not to display a border around an iframe.
Browser Support
The frameborder attribute is supported in all major browsers.
Syntax

<iframe frameborder="value">

Attribute Values
1 Border on (this is default)
0 Border off
Example
An iframe with no border:

<iframe src="/default.asp" width="200" height="200" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
Read More

How to make CSS visible only for Opera and google chrome?

Apr 18

Here is a way to make some CSS rules visible only for Opera (9.5 +)?

@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) {
       css rules
 }

here is an example:

@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) {
    #ja-main {
        width: 800px ;
    }
    #ja-left {
        width: 200px;
    }
}

For google chrome
@media screen and (-webkit-min-device-pixel-ratio:0) {

Body {}

}

Read More

CSS3 Generator

Dec 23

CSS3 Generator v1.7
http://css3generator.com/

This site help you to generate CSS3 code such as :
Border Radius
Box Shadow
Text Shadow
RGBA
@Font Face
Multiple Columns
Box Resize
Box Sizing
Outline
Transitions
Transform
Selectors
Gradients

Read More

Setting Equal Heights with jQuery

Dec 02

We wrote a script to “equalize” the heights of boxes within the same container and create a tidy grid — with little overhead.

Creating the visual effect of equal-height columns or content boxes has been a challenge ever since we abandoned table-based layouts. When developing complex web applications or site designs we’ve found that it often makes the most sense from a usability and performance standpoint to use a simple JavaScript workaround: our equalHeights() function determines the heights of all sibling elements in a container, and then sets each element’s minimum height to that of the tallest element. When JavaScript is disabled, the boxes or columns appear with varying heights, but the content remains legible and the page is still completely usable.

Read More

flipping image horizontal

Sep 26

You can use this trick to flip an image horizontal also it works on IE. Just add the following CSS class to your image.

Note: It works with source images only (not background image)

.flip-horizontal {
    -moz-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    filter: fliph; /*IE*/
}

Demo:
before:

After:

Read More

Image rotate using CSS

Jun 17

You can make an image rotate using CSS as follow:

  <style type="text/css">
    #nice a:hover img {
    -moz-transform: rotate(-3deg);
   }
  </style>
<center id="nice">
<a href="http://google.com"><img src="http://phpmysqltalk.com/wp-content/uploads/2010/06/tom-and-jerry1.jpg" alt="" title="tom-and-jerry1" width="379" height="285" class="aligncenter size-full wp-image-128" /></a>
</center>




Note:
It doesn’t work on all IE versions :-)

Read More