April 1, 200818 yr hello everyone could anybody tell me that , if i use css , do i need to write any codes for both the browsers. i mean it should open in both the browsers without any problem, with all the styling, perfectly. when i preview in both the browsers, only mozilla is supporting css. Where IE is opening with broken links and links colors. thanks in advance.
April 1, 200818 yr Hi wadheanand, The majority of CSS will work in IE and Firefox (Mozilla) without you needing to do anything special. There are only a small number of cases where you will have to tweak the CSS for it to display correctly in IE (6 usually). If you could provide us with a link to the broken page, I'm sure someone will work out what has gone wrong for you. Rob
April 1, 200818 yr Hi wadheanand, This is very simple actually what happens is that the default styles of elements set for the Browsers ( Firefox, IE, Safari, Opera etc.) are different. For example the element <p> has a default margin which varies from browser to browser. So what you need to do is just make the default value of the elements to 0. Below is the code check it a, p, img, H1, H2 { margin:0; padding:0; } When you use the above code in CSS then the default values ( for which problems occur in cross browser ) becomes 0. now you give your style below and the style which you assign to the element this will be shown in all Browsers without any problem. For eg, let us take the a element as its color varies from browser to browser. a { color:#000; text-decoration:none; margin:0 0 20px; } a:hover { color:#666; text-decoration:underline; } Now in above the element <a> is assigned a style for all links of the page and this will be same in all browsers. let me know if its clear to you or not...
April 2, 200818 yr Author Hi wadheanand, This is very simple actually what happens is that the default styles of elements set for the Browsers ( Firefox, IE, Safari, Opera etc.) are different. For example the element <p> has a default margin which varies from browser to browser. So what you need to do is just make the default value of the elements to 0. Below is the code check it a, p, img, H1, H2 { margin:0; padding:0; } When you use the above code in CSS then the default values ( for which problems occur in cross browser ) becomes 0. now you give your style below and the style which you assign to the element this will be shown in all Browsers without any problem. For eg, let us take the a element as its color varies from browser to browser. a { color:#000; text-decoration:none; margin:0 0 20px; } a:hover { color:#666; text-decoration:underline; } Now in above the element <a> is assigned a style for all links of the page and this will be same in all browsers. let me know if its clear to you or not...
Create an account or sign in to comment