473,799 Members | 3,052 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ignore CSS for a partcular div in the page

3 New Member
Hi,

I am working on a Widget that gets embedded into an existing page as a div in the body...Now I want to ensure that the my widget looks and behaves exactly the same on all web sites.

But I am running into issues where customers have setup global CSS rules for all sorts of elements like

table {border:1px solid}
a {text-decoration:unde rline}
etc.

Now is there a clean way for me to ignore all these rules without writing rules for each and very possible property?

Thanks,
Jitendra
Apr 5 '07 #1
8 14168
drhowarddrfine
7,435 Recognized Expert Expert
Add !important to the css property and it will override the user rule.
Apr 5 '07 #2
kingjng
3 New Member
I don't think that will work...I'll have to set properties for each conceivable element and all properties for each element...that could be a tall task...
Apr 5 '07 #3
Christopera
70 New Member
Instead of using general rules set span class rules.
Apr 5 '07 #4
drhowarddrfine
7,435 Recognized Expert Expert
Then there is no other way to override user CSS rules.

Now that I re-read the original post, I should say that I was thinking you meant user CSS on the individual browser. If you meant they import some global CSS file, then as long as your CSS follows theirs, then the cascade will take care of what you want. You can modify what they have but you can't delete what they have.
Apr 5 '07 #5
KevinADC
4,059 Recognized Expert Specialist
Yea, thats pretty much why they are called Cascading Style Sheets. Plus I doubt other people would like the fact you control the appearance of content that gets displayed on their site (If I understand your situation). Besides, they could just slurp your html code up and alter it anyway they want to if they know some server side stuff. All in all it sounds like a concept that is not practical.
Apr 5 '07 #6
kingjng
3 New Member
An example of the scenario I am thinking of available at Techcrunch

Steps:

1. Go to techcrunch.com
2. Click on the "sphere it" link at the end of each post
3. this causes a new div to get generated

This div popup works the same across mutiple sites... (check out www.readwritewe b.com for another example). Now these popups are custom to the site...But my question is that is there a way to generate this kind of popup without having to worry about the site specific CSS and without having to define the all CSS properties for all elements.

Thanks every one for the responses thus far.
Apr 5 '07 #7
KevinADC
4,059 Recognized Expert Specialist
The answer is: no. And you should not even be trying to do that. It's a bad idea, its not practical, and it can still be defeated even if you define ever CSS property known to man within the div itself.
Apr 5 '07 #8
It's very practical. The need to do this, normally with included HTML just like the scenario suggested, comes up all the time. There should be a CSS property that specifies css file names to read or ignore when computing the cascade. Of course it can be "defeated." That's not the point. We aren't talking about potential malicious behavior here. We are talking about convenience. The ability to ignore certain css files would be VERY convenient.
Nov 12 '10 #9

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

Similar topics

10
548
by: Nicolas Fleury | last post by:
Hi all, The part of the Python community that doesn't like @decorators needs to unite behind an alternative syntax to propose to Guido. I suggest we use this thread to try to do it. If you agree with @decorators, then I suggest you stop reading this message;) Many syntaxes have been put on http://www.python.org/moin/PythonDecorators. I suggest to fight the current @descriptors on these two points:
6
3624
by: CJM | last post by:
I have a page which allows the user to open one of several spreadsheets by streaming the XLS to the client. On my development site, everything appears to work fine. On the live site, it works fine for the vast majority of users, but not for my colleague & I. When this page is called with the correct inputs, the standard Open/Save/Cancel/More Info dialog should appear. In the dialog, it gives the following details:
2
3671
by: Daniel | last post by:
Ok folks, I have Windows XP. I installed .Net and developed some VB.Net components that I want to use in ASP.Net applications. At this point I realized I didn't have IIS installed on my XP machine, so I installed it. I then created a ASP.Net web project pointing to "localhost". I was able to run the application and get to the test.aspx page in the browser. However, it would not let me debug the application. It kept throwing an...
10
2212
by: john | last post by:
I want the page to completely ignore all mouse clicks. I can create the onmouseclick event and return false, but that only disables certain types of things. I can still, for example, click in a text box and then type something or change the selection in a dropdown list. I tried returning false in the onmousedown event, but that didn't do the trick. I'd rather not have to disabled all the controls on the page. Any ideas? Thanks in advance,...
6
8991
by: Kevin G. | last post by:
I'm not sure if this is possible, but if a page uses a CSS style sheet and you would still like to use good old <font> tags... is there a tag to tell the browser to ignore the CSS formatting just for that table cell? I work for a company that has their website built from a 3rd party. We're very restricted in how we can redesign the pages. The only "content" we're allowed to add come in after the <head> tags... so the CSS is already in...
1
2689
by: windandwaves | last post by:
Are you allowed to use the following syntax in Mysql 4.0.17-nt : INSERT DELAYED IGNORE INTO `mytable` ( `ID` , `A` , `B` ) VALUES ("'.session_id().'", "2", ROUND(NOW()/10000) ); I am particularly interested in the delayed ignore. I want to make sure that no matter what, the instruction is carried out and that, due to indexes, the data is not allowed to go in, that we do not get an error. TIA
2
5554
by: twahl | last post by:
Hi, I would like to ignore a certain exceptions in Application_Error event in Global.asax.cs file and still have the page's state be maintained. If I simply issue: Server.ClearError() I end up with a blank page. If I issue: Server.ClearError();
4
2434
by: Jon Westmore | last post by:
I'm using an ASP page to dynamically generate an XML document using a data source. I was thinking the concept would be similar to dynamically creating HTML but I'm running into an issue. Here is my source code: <%Response.ContentType = "text/xml" Response.CharSet="" Dim Connect ,RS, Query, Details Details = Trim(Request("Details"))
1
1600
by: Ganesh | last post by:
Hi There, I've a validation control in my page, In some cases i don't want to check the validation like when users click cancel, i'l take the page to home page. But it checks always validation. How can i ignore the validation when i click cancel Thanks Ganesh
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.