Jump to content

Help with a format class


co.ador

Recommended Posts

  Trying to find out why the rating part over here appear in a vertical list and with bullet when in the CSS stylesheet I have it floated to the left and list-style:none;

 

  Price:  $3.50

 

  Raiting:

 

    * 1

    * 2

    * 3

    * 4

    * 5

 

 

 

.rating {

list-style:none;

width:54px;

height:7px;

margin:0 0 3px 0;

padding:0px;

clear:both;

position:relative;

background:url(../images/NYhungry%27s%20grid%20Rating%20system.gif) no-repeat 0 0;

}

 

ul.rating li {

cursor: pointer;

float:left;

text-indent:-900em;

}

 

ul.rating li a {

position:absolute;

left:0;

top:0px;

width:12px;

height:7px;

text-decoration:none;

z-index: 200;

}

 

 

ul.rating li.one a {left:0px}

ul.rating li.two a {left:11px;}

ul.rating li.three a {left:22px;}

ul.rating li.four a {left:33px;}

ul.rating li.five a {left:44px;}

 

ul.rating li a:hover {

z-index:2;

width:54px;

height:7px;

overflow:hidden;

left:0;

background:url(../images/NYhungry%27s%20grid%20Rating%20system.gif) no-repeat 0 0;

list-style:none;

}

ul.rating li.one a:hover {background-position:0 -42px;}

ul.rating li.two a:hover {background-position:0 -49px;}

ul.rating li.three a:hover {background-position:0 -56px;}

ul.rating li.four a:hover {background-position:0 -63px;}

ul.rating li.five a:hover {background-position:0 -70px;}

 

 

HTML code.

if (Rating::CheckRatingsByIp($varItem) == 0)

          {

            $classes      = "rating" . Rating::ShowStars($averageStars);

           

            // Write Output HTML for the Rating Data

            $output  = "\r\n";

            $output .= "<ul class=\"{$classes}\" id=\"{$varItem}\">\r\n";

            $output .= "  <li class=\"one\"><a  href=\"javascript:RateItem('{$varItem}', 1);\" title=\"1 Star\">1</a></li>\r\n";

            $output .= "  <li class=\"two\"><a  href=\"javascript:RateItem('{$varItem}', 2);\" title=\"2 Stars\">2</a></li>\r\n";

            $output .= "  <li class=\"three\"><a href=\"javascript:RateItem('{$varItem}', 3);\" title=\"3 Stars\">3</a></li>\r\n";

            $output .= "  <li class=\"four\"><a  href=\"javascript:RateItem('{$varItem}', 4);\" title=\"4 Stars\">4</a></li>\r\n";

            $output .= "  <li class=\"five\"><a  href=\"javascript:RateItem('{$varItem}', 5);\" title=\"5 Stars\">5</a></li>\r\n";

$output .= "</ul>\r\n";

          }

          else

          {

            $classes      = "rated " . Rating::ShowStars($averageStars);

 

           

            // Write Output HTML for the Rating Data

            $output  = "\r\n";

            $output .= "<ul class=\"{$classes}\" id=\"{$varItem}\">\r\n";

            $output .= "  <li class=\"one\">1</li>\r\n";

            $output .= "  <li class=\"two\">2</li>\r\n";

            $output .= "  <li class=\"three\">3</li>\r\n";

            $output .= "  <li class=\"four\">4</li>\r\n";

            $output .= "  <li class=\"five\">5</li>\r\n";            

            $output .= "</ul>\r\n";

          }

        }

Link to comment
Share on other sites

Please post the HTML output, rather than the PHP code. CSS has nothing to do with PHP, only with the output of a php script.

 

Also, please use code tags - you can get them by using the '#' button that is above the textbox you type your posts into.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.