Sunday, August 14, 2016

10 useful ways using CSS

1. Rounded Corner Without Images
This is a simple technique using some css propeties.

div{
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: 1px solid #FF8855;
}


2. Background for textbox

input#sometextbox {
    background-image:url('back-image.gif');
    background-repeat:no-repeat;
    padding-left:20px;
}

3. Confige size for Frame
A very handy CSS command that exists is the min-width command, min-height, whereby you can specify a minimum width for any element. This can be particularly useful for determining the minimum width for a page.

#container {
    min-width: 600px;
    width:expression(document.body.clientWidth < 600? "600px": "auto" );
}
<div id="container">
text
</div>

5.Opaque element
.transparent_class {
    filter:alpha(opacity=50);
    -moz-opacity:0.5;
    -khtml-opacity: 0.5;
    opacity: 0.5;
}
6. Css for mobile devices, telephones, smart phones
<link type="text/css" rel="stylesheet" href="style.css" media="handheld" />

7.Omit border around the object when you click on, for example, links (links)
a:active {
    outline: none;
}
8. CSS Drop Caps
p:first-letter {
       font-size : 300%;
       font-weight : bold;
       float : left;
       width : 1em;
}
9.centered website
#page-wrap {
     width: 800px;
     margin: 0 auto;
}
<body>
  <div id="page-wrap">
    <!-- all websites HTML here -->
  </div>
</body>
10. Scrollbars in Firefox
<style type="text/css">
        html{ overflow-y:scroll; }
</style>

No comments:

Post a Comment