Page 1 of 1

Need help with css in PHP

Posted: Wed Jun 17, 2009 5:53 am
by raul_8
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.


i have no idea how to use css in php
and i have to implement a css in a php page.
following is the php section :

Code: Select all

<?php
 
       //some text
 
    print "<span class=\"input_label\">$label_convert&nbsp;</span>";
    print "<input name=\"a\" class=\"inputbox\" maxlength=\"12\" size=\"5\" autocomplete=\"off\" value=\"$str_a\"><br>";
    select_currency_pulldownmenu($currencies, 'from', $str_from);
    print '<br>';
    print "<span class=\"input_label\">$label_into </span><br>";
 
    select_currency_pulldownmenu($currencies, 'to', $str_to);
    print "<br>";
    if ($data!='') {
        print "<div id=\"currency_converter_result\" align=left style=\"padding-top:4px;padding-bottom:4px\" class=\"result\">$app->v {$_GET['from']} = <b><span $highlight>$data</span> {$_GET['to']}</b></div>";
    }
 
    print "<input type=\"submit\" value=\"$submit_button_label\" class=\"button\">&nbsp;&nbsp;";
    print "<span id=\"loading\"></span>";
?>



------------------------------------------------------------------------

and here is the css code:

Code: Select all

/*  Currency  */
#currency {width:273px; float:left; margin-top:10px; border:1px solid #DFE0E0; background:#fff;}
.currencyHead {width:263px; height:28px; float:left; padding-left:10px; margin:0; background:#fd770c; color:#fff; font-size:16px; font-weight:bold; line-height:28px; vertical-align:middle;}
 
.currencyWrap {float:left; width:263px; padding-left:10px; margin-bottom:5px; background:#fff;}
.currencyWrap label {float:left; display:block; width:45px;  margin-right:5px; padding-top:3px; color:#000; font-size:12px; font-weight:bold}
.fld_currency {float:left; padding:2px 0px; margin-right:5px; background:#fff; color:#000;}
.fld_currency input {width:45px; padding:2px 0 0 3px; float:left; color:#000; font-size:11px;}
.curr_hindden {float:left; width:260px; margin:5px 5px; text-align:center; font-size:14px; font-weight:bold}
.btnCurrency {float:right; padding-right:10px;}

Code: Select all

<!-- curency -->
<div id="currency">
<div class="currencyHead">Currency Converter</div>
        
        <div class="spacer"></div>
<div class="currencyWrap ">
            <label>Convert</label>
  <div class="fld_currency">
                <input type="text" value="001" />
  </div>
            <div class="fld_currency">
                <select>
                    <option>United States Dollar (USD)</option>
              </select>
  </div>                                        
        </div>
        
        <div class="currencyWrap">
            <label>Into </label>
          <div class="fld_currency">
                <select>
                    <option>United States Dollar (USD)</option>
            </select>
          </div>
        </div>
        
        <div class="curr_hindden">
            20 USD = 9555.2000 <span class="blue">INR</span>
    </div>                                    
        
        
        <div class="currencyWrap">
          <div class="btnCurrency">
                <input name="Submit" type="submit" class="submit_blue"  value="Convert"/>
          </div>                                      
         </div>
         
         </div>
<!--  curency -->

pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.

Re: Need help with css in PHP

Posted: Wed Jun 17, 2009 9:35 am
by raul_8
please i really need help in this

Re: Need help with css in PHP

Posted: Wed Jun 17, 2009 9:39 am
by mattpointblank
You haven't told us what the problem is. Nobody is going to debug your code without knowing what it does/doesn't do properly.

Re: Need help with css in PHP

Posted: Wed Jun 17, 2009 9:49 am
by raul_8
the problem is, i have to apply the styles in php code(given above)
the styles are given in a separate style sheet is give below the PHP code
I'm good in php but don't know anything about css please help :(

Re: Need help with css in PHP

Posted: Wed Jun 17, 2009 9:53 am
by pickle
CSS is never, ever applied to PHP code. Your PHP code generates HTML that the browser then renders and applies CSS to.

At first glance, it appears like this is a very simple question. Do a Google for "How to use CSS" - you should get some results telling you how to link a CSS file to an HTML file.