Jump to content

Parsing CSS stylesheets


Omirion

Recommended Posts

Hello,

I'm not sure how i can describe my problem so i will just explain my aim.

 

In general i want to parse a CSS sheet and extract the position properties of of every element.

Then i want to set the properties of every element (Mostly divs) using JS. (This part i can figure out on my own, but suggestions are welcome cause i'm thinking this is going to skull f*** the CPU )

 

In general i need a way to extract the position info from an external stylesheet.

 

Any ideas on the subject are more than welcome.

Even if they are purely theoretical.

 

Link to comment
https://forums.phpfreaks.com/topic/201401-parsing-css-stylesheets/
Share on other sites

Why would you want to do this?

 

In general i need a way to extract the position info from an external stylesheet.

 

This doesn't exactly make sense, could you explain it a little more? What do you mean by "position info"?

 

Because i need to use those properties later in my script.

And there is no (at least as far as i know) way of getting position properties of external style sheets.

 

The position i.e position:absolute/static/etc

left:100%/40px

top:-||-

 

 

This jQuery CSS parser may be of interest to you.

 

Thanks i think this will work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.