473,399 Members | 4,177 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,399 software developers and data experts.

CSS: Is it ok to put multiple Browser syntax into one file?

Samishii23
246 100+
Would my CSS file have issues if I put syntax for Firefox, Chrome, and IE all into the same file? Or dynamically print out the appropriate syntax based on the browser?
Feb 4 '11 #1
4 1974
drhowarddrfine
7,435 Expert 4TB
If you mean "vendor extensions" like -moz then, yes, you can insert as many as you like.
Feb 5 '11 #2
Samishii23
246 100+
Well since Mozilla and WebKit are really the only "Browsers" out, since IE, as it is basicly the most used browser out there and the least featured... like doing this:
Expand|Select|Wrap|Line Numbers
  1. filter: progid: DXImageTransform.Microsoft.gradient( startColorstr=#FFFFFFFF, endColorstr=#FF339900 );
  2. background: -moz-linear-gradient( 0% 100% 90deg, #fff, #390 );
  3. background: -webkit-gradient( linear, 0% 0%, 0% 100%, from(#fff), to(#390) );
All in the same file. Wouldn't that cause a couple of warning errors in the browser that don't support like "filter" or do they just drop em and move on, and it doesn't really effect performance, or display at all?
Feb 5 '11 #3
There is no problem inserting whatever you'd like into CSS, as the CSS-parsers only fail if a declaration isn't well-formed. This is CSS that neither make a CSs-parser crash, nor style the element:
Expand|Select|Wrap|Line Numbers
  1. element { give-color-to-background: red and blue; }
Feb 17 '11 #4
JKing
1,206 Expert 1GB
It will produce a warning but it should skip to the next declaration.

If you were to make separate stylesheets for each browser that would be an additional call to the server for each stylesheet.

It is perfectly safe to put them all in one.
Feb 17 '11 #5

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

Similar topics

1
by: Bill | last post by:
I currently have all of my Bookmarks under WinXP in a PIM, which will allow me to export them as a CSV file ( fields are "Category,Page-Title,URL,Comments - all fields of no fixed length). Is...
1
by: chirs | last post by:
Hi, 1. Can I put CSS code in a file? (similar to a .js file for javascript) If the answer is yes, can you show me an example? 2. Do VB Script file and JScript file also use .js filename...
2
by: Jean Pion | last post by:
Dear readers, Could you please advice a CSS capable browser with no frame support that runs on WinXP. Tia, Jean.
2
by: Ayoa | last post by:
I am working on some web based custom reports and i want to open multiple browser at the click of a button. So for example if i have 2 guids in my arraylist, i want to open 2 windows. protected...
3
by: Stefan Schwarzer | last post by:
Hello, from time to time I want to inspect the source code of projects on remote computers.(*) I've googled for one or two hours but didn't find anything helpful. :-/ I'm looking for something...
0
by: Stefano | last post by:
Hi all, I'm trying to create a browser definition file (.browser) that matches crawlers user agents. I don't want modify browser files in the Config system folder. I'd like to use App_Browsers...
5
by: John Salerno | last post by:
Hi everyone. I'm updating my UltraEdit syntax file for Python 2.5 and was wondering if anyone knew of other additions to make besides these. I found all of these in the What's New document, but...
1
by: fsbernard | last post by:
I want to be able to create a multiple volume zip file on the server using PHP. Anyone has any idea how one can do this?
2
by: SeanInSeattle | last post by:
Hey all. I'm working on a fairly large XSL file along with an external css file for my xml data. I'm running into cross browser issues. The code below works in IE, but not in Firefox 3.0. Any...
4
Atli
by: Atli | last post by:
Hi. Say I have these three classes: .Paragraph { width: 200px; margin: auto; } .Paragraph .Header { display: block; font-weight: bold; } .Paragraph .Text { display: block; font-size: 90%; }...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.