Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2008
    Posts
    219
    Plugin Contributions
    0

    Default inline styling of php

    I hope this is legal and hope I don't get screamed at. This is really simple for your gurus, but a PHP newbie attempting to add styling within a php file is proofing to be extremely difficult.

    Want to integrate this line:
    <li class="price"><?php echo TEXT_BASE_PRICE . $products_price; ?></li>

    with this styling

    '"style="color: red; font-size: 12px;"'



    I've tried moving the style to different places, at times the styling text displays as it appears on the page. At time the page hangs (blank page)

    Any Idea how I can combine these two..

    Many thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,531
    Plugin Contributions
    127

    Default Re: inline styling of php

    Why not change it to

    <li class="price_red"> ...

    and add price_red to your stylesheet (with "color: red; font-size: 12px;")?
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Sep 2008
    Posts
    219
    Plugin Contributions
    0

    Default Re: inline styling of php

    Quote Originally Posted by swguy View Post
    Why not change it to

    <li class="price_red"> ...

    and add price_red to your stylesheet (with "color: red; font-size: 12px;")?
    Thank you for the prompt reply. unfortunately that did not work for me.

    This is what I've done

    in my /tpl_un_wishlist_default.php the code is:

    <li class="price_red"><?php echo TEXT_BASE_PRICE . $products_price; ?></li>

    in my main stylesheet.css file I've included:

    #price_red {
    color: red;
    font-size: 12px;
    }

    This does not have any effect.

    What am I doing wrong ?

    And can both pieces of information included into the php file?

  4. #4
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: inline styling of php

    <li class="price_red"><?php echo TEXT_BASE_PRICE . $products_price; ?></li>

    in my main stylesheet.css file I've included:

    #price_red {
    color: red;
    font-size: 12px;
    }
    Your syntax is wrong -


    .price_red {
    color: red;
    font-size: 12px;
    }

    ( # is for id, . is for class )
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  5. #5
    Join Date
    Sep 2008
    Posts
    219
    Plugin Contributions
    0

    Default Re: inline styling of php

    Quote Originally Posted by Kim View Post
    Your syntax is wrong -


    .price_red {
    color: red;
    font-size: 12px;
    }

    ( # is for id, . is for class )
    Thank you so much. Strange but I had done exactly that before my last post and it had no effect. I repeat the same steps and this time it works... I could never understand why things happen the way they happen sometimes, specially with this wishlist addon.

    Just curious If I really wanted to combine the two codes, is it possible and how?


    Thank you so much kim.

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,531
    Plugin Contributions
    127

    Default Re: inline styling of php

    Quote Originally Posted by hardwiredtemplates View Post

    Just curious If I really wanted to combine the two codes, is it possible and how?
    <li class="price_red important highlight">

    where each of these is in your stylesheet as a class:

    .price_red {
    ...

    .important {
    ...

    .highlight {
    ...
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #7
    Join Date
    Sep 2008
    Posts
    219
    Plugin Contributions
    0

    Default Re: inline styling of php

    Quote Originally Posted by swguy View Post
    <li class="price_red important highlight">

    where each of these is in your stylesheet as a class:

    .price_red {
    ...

    .important {
    ...

    .highlight {
    ...

    My apologies if I was unclear. What I meant was to combine the two lines below into one as part of my .php file

    <li class="price"><?php echo TEXT_BASE_PRICE . $products_price; ?></li>

    AND

    '"style="color: red; font-size: 12px;"'

    As it looks here:

    <li><?php echo '<a href="' . zen_href_link(zen_get_info_page($products->fields['products_id']), 'products_id=' . $products->fields['products_id']) . '"style="color: red; font-size: 12px;">' . VIEW_INFO_TEXT . '</a>'; ?></li>

 

 

Similar Threads

  1. Replies: 6
    Last Post: 5 Dec 2015, 09:29 PM
  2. v139h Always Problems with the way I'm styling my custom inline Code!
    By traytray in forum Templates, Stylesheets, Page Layout
    Replies: 31
    Last Post: 18 Jun 2013, 07:16 PM
  3. Styling PhP output
    By tidy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Mar 2010, 06:16 AM
  4. display inline
    By oxymoronz in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 19 Dec 2007, 04:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg