5 CSS Tricks Every Web Designer Needs for Cross-Browser Compatible Design
Every web designer knows that feeling of anger and frustration..
Also Check: Top 5 CSS3 Best Tips And Tricks
You spend hours, days, weeks meticulously perfecting your website's CSS styling. Leonardo da Vinci himself couldn't have created a more beautiful canvas. It's just perfect. And then... out of curiosity... you open the page in Internet Explorer. Everything's ruined! Your nav bar is on the wrong side of the page, there's overlapping text everywhere, your hover effects are malfunctioning, pictures of Dracula and Hitler have replaced your bio pics. It's a nightmare, and it's one that we've all had.
Always Do These To Avoid Cross Browser Issues and Cross Browser Errors
[sws_yellow_box box_size=””] *Disclaimer: This isn’t going to make everything flawless, but it’s a damn good start. Also, I’m not including anything for Stupid IE, but these tips will still work with version 8 and above… maybe. [/sws_yellow_box]
1. Prefix css3 styles
[css]-moz- /* Firefox and other browsers using Mozilla’s browser engine */
-webkit- /* Safari, Chrome and browsers using the Webkit engine */
-o- /* Opera */
-ms- /* Internet Explorer (but not always) */ [/css]
2. Use a reset
[css]html,body,div,span,applet,object,iframe,h1,h2,
h3,h4,h5,h6,p,blockquote,a,abbr,acronym,address,
big,cite,del,dfn,em,img,ins,kbd,q,s,samp,small,
strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,
dd,ol,ul,li,fieldset,form,label,legend,table,caption,
tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,
embed,figure,figcaption,footer,header,hgroup,input,menu,
nav,output,ruby,section,summary,time,mark,audio,video {
border: 0;
margin: 0;
padding: 0;
vertical-align: baseline;
}[/css]
3. Avoid padding with widths
To fix that, add this to everything that you do from now on:
[css]* { -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; }[/css]
4. Clear your floats, always!
To clear your floats, use this snippet of CSS:
[css]If you wrap most of your elements, a really simple way would be to add this to your wrap class.
.parent-selector:after {
content: "";
display: table;
clear: both;
}[/css]
[css].wrap:after {Now your floats should be cleared.
content: "";
display: table;
clear: both;
}[/css]
5. Test it out!
I would definitely thank the admin of this blog for sharing this information with us. Waiting for more updates from this blog admin.
ReplyDeleteweb designing training in chennai
web designing course
ccna Training in Chennai
PHP Training in Chennai
ui design course in chennai
ui developer course in chennai
ReactJS Training in Chennai
ccna Training in Chennai
web designing training in chennai
Thanks for sharing a valuable blog with us. Informative and useful content to many people.
ReplyDeleteUI Development Course in Hyderabad
RPA Course in Hyderabad
Python Course in Hyderabad
Mean Stack Developer Course in Hyderabad