Current location: Hot Scripts Forums » General Web Coding » CSS » Internet Explorer, Why?

Internet Explorer, Why?

Reply
  #1 (permalink)  
Old 11-08-09, 02:09 AM
DieuxSoldat_04 DieuxSoldat_04 is offline
Newbie Coder
 
Join Date: May 2008
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Question Internet Explorer, Why?

Hey Coders,

I am currently working on a project located here: Team24CS.

Right now, I checked the site with Opera, Fire Fox and Safari and everything appears as intended. Of course, when viewed with IE, there are issues. I have never done any cross browser style sheet fixes, so I was hoping to use this as an opportunity to learn this. I have seen other sites where in the head of the HTML code, they have scripts like "if. {internet explorer}" or what not. Anyone care to share some knowledge?

I tried Googling for it, but it seems I failed at choosing the right terms

Any links or help is greatly appreciated!

Warm Regards,
Jason Xiao

P.S. I know there are validation errors. I will fix those when done
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-08-09, 04:36 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,572
Thanks: 5
Thanked 27 Times in 24 Posts
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-08-09, 07:26 PM
DieuxSoldat_04 DieuxSoldat_04 is offline
Newbie Coder
 
Join Date: May 2008
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
I will work on the errors, but I wanted to prepare myself and to learn about have a cross platform style sheet. Would anyone care to talk about this process? Doesn't even have to be a fix for the project I am working on, I just wanted to learn it.

Warm Regards,
Jason Xiao
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-09-09, 03:16 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,572
Thanks: 5
Thanked 27 Times in 24 Posts
Having a valid markup is the first rule of designing a cross platform web site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 11-09-09, 06:14 AM
wirehopper's Avatar
wirehopper wirehopper is offline
Community Liaison
 
Join Date: Feb 2006
Posts: 2,335
Thanks: 17
Thanked 92 Times in 90 Posts
The stylesheet architecture I like to use has several stylesheets:

1. base.css or layout.css - site wide common styles, dimensions and page layout
2. colors.css - colors only, including background images, and any dimensions required to support the background images
3. ie.css - IE adjustments. The server will send it if the request is from IE
4. ff.css - FF adjustments - The server will send it if the request is from FF
5. page.css - page specific CSS, for any page that has complex styles
6. Inline style - style tags for very minor adjustments on pages (embedded in <style> tags)
7. style attributes - anything that has to be forced (style="display:none"), or dimensions

Usually there are also stylesheets from toolkits or applications as well.

And, the XHTML/CSS is validated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 11-09-09, 11:45 AM
DieuxSoldat_04 DieuxSoldat_04 is offline
Newbie Coder
 
Join Date: May 2008
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, thanks for the feedback gents.

So for the 1-7 steps, what is actually written in the .php files? I understand how to use multiple CSS style-sheets, but what coding do I use on the web pages to detect the browser and use the correct style sheet?

The main reason I am putting off the validation is because we have 3 people working on the coding. [Yes we are coordinated enough to not screw up each others' edits, but the different coding style makes validating while working a little harder.]

Thanks!
Jason Xiao
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 11-09-09, 03:56 PM
wirehopper's Avatar
wirehopper wirehopper is offline
Community Liaison
 
Join Date: Feb 2006
Posts: 2,335
Thanks: 17
Thanked 92 Times in 90 Posts
The PHP should be a hierarchy - where one file handles the site wide includes/references like CSS, and it includes/manages other pages/files for the site.

Without a good architecture, it will be very difficult to maintain the site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 11-09-09, 05:26 PM
DieuxSoldat_04 DieuxSoldat_04 is offline
Newbie Coder
 
Join Date: May 2008
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
I checked the XHTML and CSS and they all validate now.

It was a problem caused by the embedded YouTube video, Server Tracker, and I forgot two ALT fields for images. I knew it wasn't big stuff ; P All fixed by changing two files. Now onward...

to the main act, what coding do I actually put on my pages to have them "call" the proper cascading style sheets based on browser?

Warm Regards,
Jason Xiao

Last edited by DieuxSoldat_04; 11-09-09 at 05:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 11-09-09, 05:54 PM
wirehopper's Avatar
wirehopper wirehopper is offline
Community Liaison
 
Join Date: Feb 2006
Posts: 2,335
Thanks: 17
Thanked 92 Times in 90 Posts
$_SERVER['HTTP_USER_AGENT'] will tell you what browser is in use.

This is IE7

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

This is FireFox

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 11-09-09, 06:13 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,572
Thanks: 5
Thanked 27 Times in 24 Posts
Or you can do it on the client side.
Code:
<!--[if IE 7]>
	your style sheet.
<![endif]-->
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Review: Internet Explorer 8 Beta 1 digioz The Lounge 2 03-31-09 07:25 AM
Internet Explorer problem? zoliky JavaScript 3 05-13-08 02:33 AM
Broswer Compatability involving a WYSIWYG Editor NomadMan JavaScript 1 08-18-07 03:20 PM
how to open word in internet explorer only daivagna ASP.NET 1 02-28-07 09:07 AM
windows xp SP2 and Internet Explorer bsilby The Lounge 5 06-19-04 11:04 PM


All times are GMT -5. The time now is 05:55 PM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.