Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to edit font color(red) ? please help :(

    Code:
    <?php
    $topics = ssi_recentTopics(8, null, 'array');
    foreach($topics AS $topic)
    {
    echo '<li>' . ''.$topic['link'] . '</li>' . '<br />';
    }
    ?>
    I call smf last post into joomla with this code.but ı want the font color red.when ı add
    Kod:
    Code:
    echo '<li style="color:red">' . ''.$topic['link'] . '</li>' . '<br />';
    this code only dot is red(.)but ı want font red

    .like this

  • #2
    New Coder
    Join Date
    Jul 2006
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to add ';' after red.

    Good luck!

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    there must be more to it,
    what exactly is $topic['link'] returning? is it just prue text, or is it return tags aswell?

  • #4
    New Coder
    Join Date
    Nov 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by martialtiger View Post
    You need to add ';' after red.

    Good luck!
    no it isn't work

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,107
    Thanks
    2
    Thanked 326 Times in 318 Posts
    Do you want the dot to be black and the text to be red?

    If so, you would leave the <li> tag the way it was and you need to use a span around the text.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    New Coder
    Join Date
    Nov 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes ı want dot black and text red.
    can you help my english is poor
    how can ı do your says?can you make this codes

  • #7
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,107
    Thanks
    2
    Thanked 326 Times in 318 Posts
    I knew that was probably going to be the next question -
    PHP Code:
    echo '<li><span style="color:red">' $topic['link'] . '</span></li><br />'
    I took out all of the extra unneeded opening/closing quotes (easier to read.)

    Edit: Sorry, left off a slash on the closing span tag...
    Last edited by CFMaBiSmAd; 01-30-2007 at 05:34 PM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #8
    New Coder
    Join Date
    Nov 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ı found something

    if
    Code:
    $topic['link']
    it is white
    but
    Code:
    if $topic['topic']
    it is red

    ı want link is red.

  • #9
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    does $topic['link'] contain an <a> tag?
    you'll need to style that, either wherever it is given its value, or in a style elsewhere.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com


  •  

    Posting Permissions

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