If this is your first visit, check our documentation. To post, register or login.

inline styling of php

Locked

Started by hardwiredtemplates on 27 Jun 2009, 12:04 AM · Views: 6,889

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
27 Jun 2009, 12:04 AM
#1
hardwiredtemplates avatar

hardwiredtemplates

Zen Follower

Join Date:
Sep 2008
Posts:
211
Plugin Contributions:
0

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

27 Jun 2009, 12:12 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

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.

27 Jun 2009, 1:41 AM
#3
hardwiredtemplates avatar

hardwiredtemplates

Zen Follower

Join Date:
Sep 2008
Posts:
211
Plugin Contributions:
0

Re: inline styling of php

swguy:

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?

27 Jun 2009, 3:08 AM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,752
Plugin Contributions:
0

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.

27 Jun 2009, 3:34 AM
#5
hardwiredtemplates avatar

hardwiredtemplates

Zen Follower

Join Date:
Sep 2008
Posts:
211
Plugin Contributions:
0

Re: inline styling of php

Kim:

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.:wacko: 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.

27 Jun 2009, 10:33 AM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: inline styling of php

hardwiredtemplates:


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.

28 Jun 2009, 4:39 AM
#7
hardwiredtemplates avatar

hardwiredtemplates

Zen Follower

Join Date:
Sep 2008
Posts:
211
Plugin Contributions:
0

Re: inline styling of php

swguy:

<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>