Wrox Programmer Forums
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 9th, 2008, 03:25 PM
Authorized User
 
Join Date: Mar 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default conditional css

Hello everyone,

Is there a way to make a conditional property within a css file ?

For eg:

.one{
top:-10px;
height:20px;
width:100px;
}

can I make any one property like width:100px applicable to IE6 only and not for any other version of IE or any other browser?

Thanks in advance!

 
Old July 9th, 2008, 03:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

There's nothing like that built in in CSS. But you could use MS' own conditional comments to feed a whole style sheet specifically to IE6.
http://msdn.microsoft.com/en-us/library/ms537512.aspx
Note that unless they've fixed it, some of their examples contain errors. What they say in the text is correct though.

--
http://yupapa.com
 
Old July 9th, 2008, 04:03 PM
Authorized User
 
Join Date: Mar 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default



Thanks a lot for the reply meow! Yes, I did try using a new css file for IE6 but the problem is that the loading doesnt take place smoothly.The browser applies the default styles first and then later load the styles for IE6 and for a second or two the screen keeps adjusting till the final settings are applied.Thats the reason I was wondering if there is any way to use conditions in a single css file.

-Thank You!

 
Old July 15th, 2008, 04:32 PM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, you cannot use a conditional property in a css file. What code is it you're having a problem with? Most issues can be resolved without needing to use separate code for IE6. Of course there are some issues that you can't get around, so if you use the MS conditional code the previous posted showed and only include the changed properties in that css file, it should load quicker. Do you have an example of what the problem is?

Shawn Steward
Web Developer
www.shawnsteward.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS HELP:! CSS EXPANDIBLE BACKGROUND FOR TITLE phpuser2000 CSS Cascading Style Sheets 2 December 19th, 2007 12:36 AM
Rich's new CSS book: Beginning CSS 2nd Edition jminatel BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 June 15th, 2007 11:55 AM
conditional IF roy_mm Reporting Services 0 October 30th, 2006 07:52 AM
Datagrid Conditional ~Bean~ ASP.NET 1.0 and 1.1 Basics 3 July 27th, 2005 12:40 AM
Conditional IF statement iloveoatmeal Classic ASP Basics 5 July 20th, 2005 08:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.