php and css, need help please

Discussion in 'PHP' started by s.jns, Jul 27, 2010.

  1. #1
    I need some help about how to fix the width and height in css using php code

    <style>
    #cont{width:<?php 40+(3*$thumbs_width);?>px;margin:0 auto;background:#ffffff;text-align:left;padding:10px}
    .mask1{position:relative;width:<?php 3*$thumbs_width;?>px;height:<?php 2*$thumbs_height ?>px;overflow:hidden;}
    </style>


    any help would be wellcome and thanks in advance
     
    s.jns, Jul 27, 2010 IP
  2. ze0xify

    ze0xify Peon

    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <style>
    #cont{width:<?php echo 40+(3*$thumbs_width);?>px;margin:0 auto;background:#ffffff;text-align:left;padding:10px}
    .mask1{position:relative;width:<?php echo 3*$thumbs_width;?>px;height:<?php echo 2*$thumbs_height ?>px;overflow:hidden;}
    </style>
    PHP:
     
    ze0xify, Jul 28, 2010 IP
  3. arpit13

    arpit13 Well-Known Member

    Messages:
    294
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #3
    this should be like this:
    
    <style>
    #cont{width:<?php echo 40+(3*$thumbs_width);?>px;margin:0 auto;background:#ffffff;text-align:left;padding:10px}
    .mask1{position:relative;width:<?php echo 3*$thumbs_width;?>px;height:<?php 2*$thumbs_height ?>px;overflow:hidden;}
    </style>
    
    PHP:
    you didn't used echo
     
    arpit13, Jul 28, 2010 IP
  4. s.jns

    s.jns Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    thanks to all of you, now it was fixed
     
    s.jns, Jul 28, 2010 IP
  5. arpit13

    arpit13 Well-Known Member

    Messages:
    294
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #5
    Your Welcome We Are Always Here To Help ;)
     
    arpit13, Jul 28, 2010 IP
  6. kargaa

    kargaa Well-Known Member

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #6
    <?= ?>
    could be also if your shorttags are open normally <?php echo ?> thing old odd thing
     
    kargaa, Jul 28, 2010 IP
  7. arpit13

    arpit13 Well-Known Member

    Messages:
    294
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #7
    yes this can be done like that as well.
    
     <style>
    #cont{width:<?=40+(3*$thumbs_width);?>px;margin:0 auto;background:#ffffff;text-align:left;padding:10px}
    .mask1{position:relative;width:<?=3*$thumbs_width;?>px;height:<?=2*$thumbs_height ?>px;overflow:hidden;}
    </style>
    
    PHP:
     
    arpit13, Jul 28, 2010 IP