gpt4 book ai didi

java - 小星级评分的jsp页面

转载 作者:行者123 更新时间:2023-11-28 03:41:23 25 4
gpt4 key购买 nike

我有一个页面,star.jsp,我有他的css代码,style.css,它工作正常,但我希望星星更小。

我的代码

star.jsp

    <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link href="css/style.css" rel="stylesheet" type="text/css">

<title>Notation</title>
<script type="text/javascript">
function notation(starId) {

var elements = document.getElementsByClassName("notation-star-
selected");

for (i = 0; i < elements.length; i++) {
elements[i].className = "notation-star";
}


document.getElementById(starId).className = "notation-star-
selected";


document.getElementById("notationNote").value = starId.substr(4,
4);

var note = document.getElementById("notationNote").value =
starId.substr(4, 4);

document.getElementById("vote").innerHTML = note.valueOf();



}
</script>



</head>

<div class="notation-text">Votre avis nous est très précieux pour
améliorer la qualité de notre service</div>


<form method="post" action="voting">
<div id="star5" class="notation-star" onClick="notation(this.id);"></div>
<div id="star4" class="notation-star" onClick="notation(this.id);"></div>
<div id="star3" class="notation-star" onClick="notation(this.id);"></div>
<div id="star2" class="notation-star" onClick="notation(this.id);"></div>
<div id="star1" class="notation-star" onClick="notation(this.id);"></div>
<input type="hidden" id="notationNote" name="notation_note" value="0">
<input type="submit" value="ok"></form <br>

<p id="vote"></p>

</html>

我的代码

样式.css

body {
font-family: Verdana, arial;
}

.notation-text {
color: #000000;
font-size: 18px;
text-align: center;
margin: 18px;
}

.notation-block-star {
display: table;
margin: 0 auto;
width: inherit;
}


.notation-star {
background-image: url("../images/etoile_grise.png");
background-repeat: no-repeat;
cursor: pointer;
display: table-cell;
float: right;
height: 64px;
width: 64px;
padding: 10 5px;
}


.notation-star:hover,
.notation-star:hover ~ .notation-star {
background-image: url("../images/etoile_jaune.png");
}

.notation-star-selected {
background-image: url("../images/etoile_jaune.png");
background-repeat: no-repeat;
cursor: pointer;
display: table-cell;
float: right;
height: 64px;
width: 64px;
padding: 0 5px;
}

.notation-star-selected ~ .notation-star {
background-image: url("../images/etoile_jaune.png");
}

我更新了 widthheight 并添加了 font-size但它仍然没有用。 after update <code>height and weight</code>

最佳答案

示例工作代码希望这能解决您的问题

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link href="css/style.css" rel="stylesheet" type="text/css">

<title>Notation</title>


<style>
body {
font-family: Verdana, arial;
}

.notation-text {
color: #000000;
font-size: 18px;
text-align: center;
margin: 18px;
}

.notation-block-star {
display: table;
margin: 0 auto;
width: inherit;
}


.notation-star {
background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Empty_Star.svg/2000px-Empty_Star.svg.png");
background-repeat: no-repeat;
cursor: pointer;
display: table-cell;
float: right;
height: 20px;
width: 20px;
padding: 10 5px;
background-size: cover;
}


.notation-star:hover,
.notation-star:hover ~ .notation-star {
background-image: url("http://findicons.com/files/icons/1035/human_o2/128/bookmark_new.png");
}

.notation-star-selected {
background-image: url("../images/etoile_jaune.png");
background-repeat: no-repeat;
cursor: pointer;
display: table-cell;
float: right;
height: 64px;
width: 64px;
padding: 0 5px;
}

.notation-star-selected ~ .notation-star {
background-image: url("../images/etoile_jaune.png");
}
</style>

</head>

<div class="notation-text">Votre avis nous est très précieux pour
améliorer la qualité de notre service</div>


<form method="post" action="voting">
<div id="star5" class="notation-star" onClick="notation(this.id);"></div>
<div id="star4" class="notation-star" onClick="notation(this.id);"></div>
<div id="star3" class="notation-star" onClick="notation(this.id);"></div>
<div id="star2" class="notation-star" onClick="notation(this.id);"></div>
<div id="star1" class="notation-star" onClick="notation(this.id);"></div>
<input type="hidden" id="notationNote" name="notation_note" value="0">
<input type="submit" value="ok"></form <br>

<p id="vote"></p>

</html>

关于java - 小星级评分的jsp页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44199516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com