Here are some simple yet effective and useful CSS tips and tricks for beginners.
1. Whenever Possible always enable Gzip Compression on server side as it will reduce the size of CSS and JavaScript files without losing any content.
2. Group together the CSS elements that uses the same poperties and values. It will reduce the work of repetition. To group elements together use comma as a seperator.
Example – h1 { color:#011; }
h2 { color:#011; }
Combine them as such:
h1, h2 { color:#011; }
3. Always use whitspace to format your CSS stylesheets. Whitespace is important for CSS readability.
4. Use following stylesheet to add background image to any input box.
input#sometextbox {
background-image:url(‘back-image.gif’);
background-repeat:no-repeat;
padding-left:10px;
}
5. Use following stylesheet to make an element transperant by setting the opacity level.
.transparent_class {
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
Related Posts...
CSSWeb Design
Apr 18th, 2024
Your corporate website is a critical component in shaping perception of your brand. Discover how elements like design, content, and UX influence how customers view your company. We break down key strategies to align your site with your brand identity.
Read more
Apr 11th, 2024
Discover how Singsys’ expertise in website development can help your business succeed with responsive and intuitive websites. Enhance user experience and boost conversions today!
Read more
Apr 2nd, 2024
As consumers’ expectations continue to rise, delivering an exceptional user experience (UX) has become a key differentiator for businesses seeking to gain a competitive edge.
Read more