Grab Certain Sections from Stylesheet

Discussion in 'PHP' started by JosS, Sep 18, 2007.

  1. #1
    I got hundreds of stylesheets but i need to grab certain parts out of them. All are layed out similar to the one below and I need to grab the sections in red.

    
    <style type="text/css">
    
    
    table, tr, td { background-color:transparent; border:none; border-width:0;}
    [COLOR="Red"]body {
    	background-color:black;
            background-image:url('http://www.imageshack.us/bg.gif');
    	background-attachment:fixed;
    	background-position:top left;
    	background-repeat:repeat;
    	 }[/COLOR]
    
    table table { border: 0px }
    table table table table{border:0px}
    table table table {
    	border-style:solid;
    	border-width:6px;
    [COLOR="Red"]	border-color:ff007e;[/COLOR]
    	background-color:000000;
    
    	   		}
    table, tr, td, li, p, div { font-family:arial; color:fff; font-size:12px;     } 
    .btext { font-family:arial; color:fff; font-size:12px;     } 
    .blacktext11 { font-family:arial; color:fff; font-size:12px;     } 
    .blacktext12 { font-family:arial; color:fff; font-size:12px;     } 
    .lightbluetext8 { font-family:arial; color:fff; font-size:12px;     } 
    .orangetext15 { font-family:arial; color:fff; font-size:12px;     } 
    .redtext { font-family:arial; color:ff007e; font-size:11px;     } 
    .redbtext { font-family:arial; color:ff007e; font-size:12px;     } 
    .text { font-family:arial; color:fff; font-size:12px; font-weight:bold;    } 
    .whitetext12 { font-family:arial; color:fff; font-size:12px; font-weight:bold;    } 
    a:active, a:visited, a:link { font-family:arial; color:[COLOR="Red"]ff007e[/COLOR]; font-size:12px;     } 
    a:hover { font-family:arial; color:white; font-size:12px;     } 
    a.navbar:active, a.navbar:visited, a.navbar:link { font-family:arial; color:white !important; font-size:12px; font-weight:bold;   } 
    a.navbar:hover { font-family:arial; color:white; font-size:12px;     } 
    a.redlink:active, a.redlink:visited, a.redlink:link { font-family:arial; color:ff007e; font-size:12px;     } 
    a.redlink:hover { font-family:arial; color:white; font-size:12px;     } 
    .nametext { font-family:arial; color:ff007e; font-size:12px;     } 
    
    
    </style>
    
    
    
    
    Code (markup):
     
    JosS, Sep 18, 2007 IP
  2. omgitsfletch

    omgitsfletch Well-Known Member

    Messages:
    1,222
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    145
    #2
    Hmm, you probably want to use preg_match() to find certain areas. Writing it to grab the body tag should be fairly trivial, but it's going to be a bit harder to grab the colors from the big slop of CSS. I'll see if I can't write something for you later today (in between classes for a short time right now)
     
    omgitsfletch, Sep 18, 2007 IP
  3. JosS

    JosS Guest

    Messages:
    369
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I know, that's why i'm having so much difficulty with it :(

    That'd be fantastic if you can
     
    JosS, Sep 18, 2007 IP
  4. JosS

    JosS Guest

    Messages:
    369
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    anybody :( ?
     
    JosS, Sep 19, 2007 IP
  5. JosS

    JosS Guest

    Messages:
    369
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Is there any way to just grab the body { } stuff out?
     
    JosS, Sep 20, 2007 IP