CSS: Drop Caps

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:

CSS: How to Create Multiple Borders in CSS3

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.

    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;

Override Inline Styles with CSS

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.

We can fight that with this:

div[style] {
   background: yellow !important;

HTML iframe frameborder Attribute

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.

<iframe frameborder="value">

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

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

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

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 {}


Setting Equal Heights with jQuery

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.

flipping image horizontal

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*/



Image rotate using CSS

You can make an image rotate using CSS as follow:

  <style type="text/css">
    #nice a:hover img {
    -moz-transform: rotate(-3deg);
<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>

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

Pin It on Pinterest