Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    13
    Member #
    18829
    Good morning,
    I've just found this site via google and hopefully it can help me. I'm trying to re-design my website, and having had 2 disasters with paying for web designers who haven't fully implemented, I am at the limits of my knowledge.
    I spent quite a long night yesterday putting together a 'dynamic' tag cloud, of which I'm pretty proud!
    However it's ignoring the colours I defined in the style sheet, but using the sizes?
    Anyone got any ideas why?
    The page is
    http://beta.pocketpcsoft.net/
    The bit in question is half way down under More Software Categories
    The style sheet shows:

    Code:
    /* === Gregs Tag Cloud =========================================================*/
    #tagcloud {
         background:#FFF;
        /*color:#0066FF;*/
        padding: 10px;
        border: 1px solid #FFE7B6;
        text-align:center;
    }
     
    #tagcloud a:link, #tagcloud a:visited {
        text-decoration:none;
    }
     
    #tagcloud a:hover, #tagcloud a:active {
        text-decoration: underline;
        /*color: #000;*/
    }
     
    #tagcloud span {
        padding: 4px;
    }
     
    .smallest {
        font-size:20px;
     color:#de2159;
    }
     
    .small {
        font-size:25px;
     color:#87a800;
    }
     
    .medium {
        font-size:30px;
     color:#de2159;
    }
     
    .large {
        font-size:35px;
     color:#039faf;
    }
     
    .largest {
        font-size:40px;
     color:#ff7600;
     }
    The relevant part of the PHP is
    Code:
    foreach ($terms as $k) // start looping through the tags
    {
        // determine the popularity of this term as a percentage
        $percent = floor(($k['counter'] / $maximum) * 100);
     
        // determine the class for this term based on the percentage
        if ($percent <20)
        {
            $class = 'smallest';
        } elseif ($percent>= 20 and $percent <40) {
            $class = 'small';
        } elseif ($percent>= 40 and $percent <60) {
            $class = 'medium';
        } elseif ($percent>= 60 and $percent <80) {
            $class = 'large';
        } else {
            $class = 'largest';
        }
     
        // output this term
        echo "<span class=\"$class\"><a href=\"../php/trackcloud.php?type=" . urlencode($k['term']) . "\">" . $k['displayterm'] . "</a></span>\n ";
    }
    This is my first time using CSS so I'm a little lost as to why it's not working. Any help would be much appreciated.
    Regards,
    Greg

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    I'm just stabbing at this one ...


    Try taking out the <div> and </div> in red ...

    <div>
    <span class="smallest"><a href="../php/trackcloud.php?type=conv">Converters</a></span>
    .
    .
    .
    .
    <span class="smallest"><a href="../php/trackcloud.php?type=vid">Multimedia and Video</a></span>
    </div></div>

    It might work like that, or you might have to define the id ...
    experiment with one of the colors to see if this works:

    #tagcloud.small {
    font-size:25px;
    color:#87a800;
    }


  4. #3
    Junior Member
    Join Date
    Apr 2009
    Posts
    13
    Member #
    18829
    thanks, I've stripped it all down to a very basic page and the issue is still there
    Strangely enough Dreamweaver sees the correct colour and size in the page properties if I highlight the word, but not in the WYSIWYG view...
    I also tried adding tagcloud in front of smallest, but that didn't work either
    Test page is http://beta.pocketpcsoft.net/testindex.php
    regards,
    greg

  5. #4
    Senior Member ravensjeff's Avatar
    Join Date
    Aug 2007
    Location
    Maryland
    Posts
    125
    Member #
    15751
    On line 21 of style.css you have:


    Code:
    a {
    color:#000000;
    text-decoration:none;
    }


    The anchor attribute is overriding the color you specify in the span class.

    Try this instead which defines the color for the anchor when it is a descendant of the span class:


    Code:
    .smallest a{
    color:#DE2159;
    font-size:15px;
    }

  6. #5
    Junior Member
    Join Date
    Apr 2009
    Posts
    13
    Member #
    18829
    ravensjeff - that has worked, many thanks


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:18 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com