473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Two CSS file for same html page

119 100+
Hi to all,

My problem is.. i am using one CSS file for my page. it works very fine for Fire fox, but if i open in IE the design which worked properly in firefox is not displaying properly in IE.

So i creating another CSS file which is comfortable with that IE window. now what i want do is

i want to check for which internet Explorer is running, if it is IE then IE.css file should execute, if Fire fox is running the page Firefox.CSS should execute.

How can i furnish this task, can any one help me please,

Thanks in advance,

Regards
magesh
Dec 11 '08 #1
7 1765
Dormilich
8,658 Expert Mod 8TB
you can use conditional comments. more here

you may consider writing a css base file (which works for the standard complient browsers) and add the IE specific hacks via CC.

regards
Dec 11 '08 #2
phpmagesh
119 100+
Hi

Thanks for your guidance,

If possible can you tell me the name for Mozilla Firefox 3.0.4's short name? like for Internet Explorer6, we will call as IE6, ......IE5, etc..,

or where i can find the name for all browsers, since i want to use that in my page to check compatibility

Thanks in advance,

Regards
magesh
Dec 11 '08 #3
Dormilich
8,658 Expert Mod 8TB
conditional comments only work in IE. usually a standard compliant CSS works across all browsers (except IE). so you only need to concern which hacks to apply for IE and include those in CC.

regards
Dec 11 '08 #4
phpmagesh
119 100+
@Dormilich
Hi,

I tried the following code but i didnt get and reaction for this in my Internet Explorer 6.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <link href="default.css" type="text/css" rel="stylesheet" />
  4.  
  5. <!--[if lte IE 6]>
  6. <link rel="stylesheet" href="ie6.css" type="text/css" media="screen" title="IE6" charset="utf-8">
  7. <![endif]-->
  8.  
  9. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  10.  
  11. <title>Tilte of the page</title>
  12.  
  13. </head>
  14. <body>
  15. .....
  16. ......
  17. </body>
  18. </html>
  19.  

Can you please help me if any mistakes in the above sample.

thanks in advance,


Regards
magesh
Dec 11 '08 #5
Dormilich
8,658 Expert Mod 8TB
I can't see an error there. the only thing possible is that the media attribute is not properly supported.....

I need to have a look at the code/page to tell more.

regards
Dec 11 '08 #6
phpmagesh
119 100+
My Template code:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <!--[if IE 6]>
  5. <link rel="stylesheet" href="style1.css" type="text/css" />
  6. <![endif]-->
  7. <link href="style.css" type="text/css" rel="stylesheet" />
  8. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  9. <!-- TemplateBeginEditable name="doctitle" -->
  10. <title>Mysite</title>
  11. <!-- TemplateEndEditable -->
  12. <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
  13. </head>
  14. <body>
  15. <center>
  16. <table cellpadding="0" cellspacing="0" border="0" width="1000px">
  17. <tr>
  18. <td width="500px"><img src="images/top1-1.jpg" /></td><td><img src="images/top1-2.jpg" /></td>
  19. <td><img src="images/top1-3.jpg" /></td><td><img src="images/top1-4.jpg" /></td></tr>
  20. </table>
  21. <div id="links"><table cellpadding="0" cellspacing="1" border="0">
  22. <tr><td><a href="Home.html">Home</a>  |  </td><td> <a href="Services.html">Services</a>  |  </td><td> <a href="Certifications.html">Certifications</a>  |  </td><td> <a href="Success_stories.html">Success Stories</a>  |  </td><td> <a href="Contact_us.html">Contact us</a></td></tr></table></div>
  23. </center>
  24. </body>
  25. </html>
  26.  
  27.  
This is the exact code i used to ork in my website,

Problem is i used div tag for menus id is links, i have declared everything in px for that id like top:342px; left:220px; etc..,

when i use to see this page in IE i m getting the menus little bit above the desired place, but it coming correctly in mozilla fire fox.

For such problem i planned to use two CSS file one for Fire fox and another for IE's...

This is my problem, i hope you understood my entire problem,

can you help me in this,


Thanks in Advance

Regards
magesh
Dec 11 '08 #7
drhowarddrfine
7,435 Expert 4TB
@phpmagesh
FF or, more specifically, FF3.04. Technically, Mozilla says it should be called Fx but few people do that.

You will never get IE to attempt to perform like modern browsers without a proper doctype. It is in quirks mode. See the article about doctypes under HTML Insights at the top of this page. Then you will find that IE will perform much more closely to other browsers (but not quite).

In addition, you are closing some elements with this: /> . That is a XHTML end tag. Remove the slash. In some instances, a browser may quit rendering at that point but a bit.

EDIT: So, while typing all that in response to the earlier post, I read down to the last one and saw you are using the XHTML doctype so disregard all that.
Dec 12 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via...
7
by: moondaddy | last post by:
I want to dynamically create a JavaScript file and cache it on the client for re-use. I know how to write javascript to a web page from the code behind, but I don't know how to actually create a...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.