1. Remove hyperlinks or textbox highlight border.

The following code will remove doted border from hyperlinks and input box when clicked.
a, input {
	outline: none;
}

2. Prevent line break

Forces the text display in one line.
h1{
   white-space: nowrap;
}

3. Remove vertical scrollbar from text area in IE.

textarea{
	overflow: auto;
}

4. Force page breaks when printing your document.

Set the page-breaking behavior to always break before an h1 element:
@media print
{
  h1 {page-break-before: always}
}
Set the page-breaking behavior to always break after an h1 element:
@media print
{
  h1 {page-break-after: always}
}
Set the page-breaking behavior to avoid breaking inside <p> elements:
@media print
{
p {page-break-inside: avoid}
}

5. min-height fix for IE

.divClass {
   min-height: 400px
   height: auto !important
   height: 400px
}

6. Display Scrollbar in Firefox

html { overflow-y: scroll; }

7. Change Text Selection Color in CSS

/* Mozilla based browsers */
::-moz-selection {
background-color: #FFA;
color: #000;
}

/* Works in Safari */
::selection {
background-color: #FFA;
color: #000;
}

8. Drop Cap - Capital Letters with CSS

p:first-letter {
  font-family:'Monotype Corsiva', Arial, verdana;
  font-size : 500%;
  font-weight : bold;
  float : left;
  padding: 0;
  margin: 5px 10px 0 0;
  align: justify;
  text-transform: uppercase;
}

Output:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a porttitor elit, id gravida eros. Curabitur aliquet lacus non purus facilisis ornare. Sed adipiscing enim vitae lacus pellentesque auctor.


Top