SitePoint Sponsor

User Tag List

Results 1 to 25 of 96

Threaded View

  1. #1
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Hampshire UK
    183 Post(s)
    6 Thread(s)

    CSS - Test Your CSS Skills Number 16

    CSS - Test Your CSS Skills Number 16 : Quiz finished - See solutions in post #54

    As last weeks quiz seemed a bit hard we are going to change direction and make this one even harder

    However, it's a smaller project and won't need so much code so don't be frightened away. I am also including a smaller and easier quiz at the end so that beginners and intermediates can try their hand at something.

    The first quiz has been supplied by Tommy (Autistic Cuckoo) and if you take a look at the attachment called graph.png you will see what needs to be done.

    The attachment shows a bar graph of browsers statistics for the year. Your mission once again is to produce that graph from the html supplied. You are not allowed to touch the html and can only add CSS in the head.

    Here is the nice semantic html that you must use.

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "">
    <html lang="en">
    <title>2008 Browser Statistics</title>
    <style type="text/css">
        2008 Browser Statistics
            <tr class="ie">
                <th>Internet Explorer</th>
            <tr class="ff">
            <tr class="saf">
            <tr class="op">
    <script type="text/javascript">
          (function () {
            var td = document.getElementsByTagName("TD");
            for (var i = 0, n = td.length; i < n; ++i) {
                var pct = parseFloat(td[i] * 10.0;
                td[i].style.height = pct + "px";
    You will notice there is some javascript at the bottom of the html and this is to create the column heights based on the data that is held in the table. You don't really need to know how this works and you don't need to touch it.

    What you need to know is that the JS will write into each opening td tag the following inline style with a value relevant to the data.

    <td style="height: 547px;">54.7%</td>
    Therefore you must find a way to color those columns at their representative heights and merge all columns into one row as shown in the attachment (graph.png). Then you need to move the headings to the side of the graph as shown in the attachment.

    If any of that is unclear then just shout and I will clarify.


    1) don't touch the html - Just add CSS in the head.

    2)Valid CSS2.1

    3) Must work in Firefox3 and Opera 9.5+ (and Safari3 if you want). IE7 won't play ball fully with this so I've omitted it but you are welcome to try and get something going in IE7 or make it degrade nicely but don't compromise the code to do this.

    General Rules:

    No extra javascript or scripting of any kind
    No images or background images.
    No Hacks
    Firefox3 and Opera9.5 support only required

    As usual there are no prizes other than the self-satisfaction of completing this. If you have a valid layout then post a message here but PM me the solution so that other people can still have a go. I will decide on the best layout this time rather than the first one I receive and the criteria may be based on code and looks.

    Be aware that this quiz may not produce a valid day-to day real world use (cross browser) but the techniques used to create it are essential tools in your css toolbox.

    2nd smaller Coffee break quiz
    Here follows a smaller quiz for those that don't have much time

    This was suggested by Yurikolovsky and is a nice little rollover effect. Look at the attachment called rolloverbox.gif which is a simple fixed width and height box with text.

    All you need to do is to change the box on hover as shown. Every part of the box should be active and point to the same location.

    The problem is that the text is not an anchor and you must use html like this.

    <p>for air travel</p>
    As this needs to work in IE6 then you are allowed to add only one anchor to each box but you are allowed to add extra divs and other elements if you need.

    That's all there is to it.

    Just make the box rollover and all parts of the box are active and would proceed to the destination in the anchors href. Every part of the box must stay in the on position when the mouse is over and must not flicker.

    The text does not change colour but the background and borders do.

    The code must be valid html and css so you cannot wrap an anchor around the whole lot as that would be invalid and cheating.

    Solutions to both quizzes will be posted later in the week (or longer) depending on how it goes

    Have fun .


    PS. : In case you missed the other tests you can find them here:
    test 1:
    test 2:
    test 3:
    test 4:
    test 5:
    test 6:
    test 7:
    test 8:
    test 14:
    test 15:
    Attached Images Attached Images


Posting Permissions

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