mtorbin Posted March 25, 2009 Share Posted March 25, 2009 Hey all, I don't know if this is possible but I want to know if there's a declaration that I can call to CANCEL a previously declared style. Consider the following: At some point in my page, I have something like this (fictional example): <style type="text/css">.myStyle{background-color:#ff0000; width:500px;}</style> Later on, I want to REMOVE the width declaration (not patch over it, I know how to do that) so that the only active declaration is the background-color. Is this possible? Thanks, - MT Link to comment https://forums.phpfreaks.com/topic/151058-css-declaration-to-cancel-a-previous-declaration/ Share on other sites More sharing options...
jceresini Posted March 27, 2009 Share Posted March 27, 2009 You could create a second style with the same settings minus the width, such as <style type="text/css"> .myStyle{background-color:#ff0000; width:500px;} .myStyleExpanded{background-color:#ff0000;} </style> Then use javascript to update the objects style classname. Not sure if that will suffice for what you are trying to do,but its one approach Joe Ceresini Network Engineer [email protected] HostMySite.com Link to comment https://forums.phpfreaks.com/topic/151058-css-declaration-to-cancel-a-previous-declaration/#findComment-795568 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.