diedVIPs

html knowhow

Graphische Darstellung einer Bewertung












Graphische Darstellung einer Bewertung

Mit diesem Script kann man nicht selbst bewerten, sondern nur eine Bewertung graphisch darstellen
So sieht´s aus

4.1 Punkte bei 254 Bewertungen.


5 Sterne
150
4 Sterne
63
3 Sterne
15
2 Sterne
6
1 Stern
20


Quellcode
<html>
<head>

<style type="text/css">
* {box-sizing: border-box;}
.heading {font-size: 25px; margin-right: 25px;}
.fa {font-size: 25px;}
.checked {color: orange;}
/* Three column layout */
.side {float: left; width: 15%; margin-top:10px;}
.middle {margin-top:10px; float: left; width: 70%;}
/* Place text to the right */
.right {text-align: right;}
/* Clear floats after the columns */
.row:after {content: ""; display: table; clear: both;}
/* The bar container */
.bar-container {width: 100%; background-color: #f1f1f1; text-align: center; color: white;}
/* Individual bars */
.bar-5 {width: 60%; height: 18px; background-color: #04AA6D;}
.bar-4 {width: 30%; height: 18px; background-color: #2196F3;}
.bar-3 {width: 10%; height: 18px; background-color: #00bcd4;}
.bar-2 {width: 4%; height: 18px; background-color: #ff9800;}
.bar-1 {width: 15%; height: 18px; background-color: #f44336;}
/* Responsive layout - make the columns stack on top of each other instead of next to each other */
@media (max-width: 400px) {
.side, .middle {width: 100%;}
.right {display: none;} }
</style>
</head>

<body>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
<p>4.1 Punkte bei 254 Bewertungen.</p>
<hr style="border:3px solid red"/>

<div class="row">
<div class="side">
<div>5 Sterne</div>
</div>
<div class="middle">
<div class="bar-container">
<div class="bar-5"></div>
</div>
</div>
<div class="side right">
<div>150</div>
</div>
<div class="side">
<div>4 Sterne</div>
</div>
<div class="middle">
<div class="bar-container">
<div class="bar-4"></div>
</div>
</div>
<div class="side right">
<div>63</div>
</div>
<div class="side">
<div>3 Sterne</div>
</div>
<div class="middle">
<div class="bar-container">
<div class="bar-3"></div>
</div>
</div>
<div class="side right">
<div>15</div>
</div>
<div class="side">
<div>2 Sterne</div>
</div>
<div class="middle">
<div class="bar-container">
<div class="bar-2"></div>
</div>
</div>
<div class="side right">
<div>6</div>
</div>
<div class="side">
<div>1 Stern</div>
</div>
<div class="middle">
<div class="bar-container">
<div class="bar-1"></div>
</div>
</div>
<div class="side right">
<div>20</div>
</div>
</div>
</body>

</html>







Kontakt    Datenschutz    Impressum