#1 (permalink)  
Old 01-25-2006, 08:50 AM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,445
Extracting Single Values From CSS Definitions?

Is it possible to somehow extract a single value from a CSS definition and store it as a variable?

Let's say that I have the following style definition:
Code:
.windowbg {
background-color: #ffffff;
font-size: 11px;
font-weight: normal;
font-style: normal;
font-family: Verdana, sans-serif;
color: #000000;
}
If I want to extract the "color" definition (which, in this case, is #000000), and store it as a variable, is this possible?

I am eventually trying to get it into a Perl variable, but I can certainly use javascript, if need be, to accomplish this task.

The reason I am trying to do this:
I am working on using ImageShack's syndication, which places an ImageShack uploader into an iFrame, and you can define certain style attributes of the iFrame in the query string portion of the source URL. I need to be able to pull the user's text color out of their CSS file somehow, and use that as the text color within the iFrame. The source URL looks something like:
Code:
<iframe src="http://www.imageshack.us/iframe.php?txtcolor=000000&type=forum&size=50">
Any thoughts?
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote

  #2 (permalink)  
Old 01-25-2006, 01:00 PM
Deadeye's Avatar
Moderator
 
Join Date: Aug 2005
Location: San Diego, CA
Posts: 274
Send a message via MSN to Deadeye
Unless you have direct access to the CSS file, as in you wrote it in your PERL script, Then I dont think there is any way to extract the color from the CSS file.

*edit* come to mind I the only way I know how to do this would to write a PERL file to goto the CSS file directly and "look" for the correct class and grab any color values inside that class.
Reply With Quote
  #3 (permalink)  
Old 01-25-2006, 05:52 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,445
Hmm. I suppose that means I could use an fopen command, and then perform a search. That would waste a lot of resources, I think, though.

Onto plan B, I suppose.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Tips & Tricks - Tutorials and more... Webnauts Programming and Scripting 12 06-20-2007 10:35 PM
Help centering elements on page in CSS RiderOfTheStorm Programming and Scripting 2 04-08-2006 03:11 PM
CSS adding a random word?!? HelpTony Programming and Scripting 5 02-14-2006 08:19 AM
css external sheet ammy Programming and Scripting 10 01-05-2006 12:04 PM
Cross-browser: Netscape/Firefox values equivalent for IE5 for vertical scroller salus Programming and Scripting 1 03-29-2005 09:35 AM


All times are GMT -5. The time now is 05:29 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter