更改按钮的背景图像(Change the background-image of a Button)
无法将按钮的图像更改为箭头,尝试了多项但却没有完全奏效。
button .arrow{ background-image: url("http://alexoliveira.me/Hawaii/images/chevron-left.png"); background-repeat: no-repeat; background-position: 50% 50%; /* put the height and width of your image here */ height: 50px; width: 200px; border: none; } .arrows { width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; position:absolute; }<div class="arrows"> <button onClick="carousel(-1)" class="arrow" style="width:20px;height:40px;"></button> <button onClick="carousel(1)" src="http://alexoliveira.me/Hawaii/images/chevron-right.png" class="arrow" style="width:20px;height:40px;"></button> </div>Can't change the image of the button to the arrows,tried multiple things but didn't quite work.
button .arrow{ background-image: url("http://alexoliveira.me/Hawaii/images/chevron-left.png"); background-repeat: no-repeat; background-position: 50% 50%; /* put the height and width of your image here */ height: 50px; width: 200px; border: none; } .arrows { width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; position:absolute; }<div class="arrows"> <button onClick="carousel(-1)" class="arrow" style="width:20px;height:40px;"></button> <button onClick="carousel(1)" src="http://alexoliveira.me/Hawaii/images/chevron-right.png" class="arrow" style="width:20px;height:40px;"></button> </div>最满意答案
只需将你的css更新为button.arrow(删除空格)。 你必须调整你的样式表
just update your css to button.arrow (remove the space). you have to adjust your stylesheet then
更多推荐
发布评论