我是新来的。
我有另一家公司的捐赠维吉特,我们已将其放置在我们的网站中。我们需要在菜单项旁边的下拉菜单中更改照片的大小。我们想将其更改为50px x 50px。
我只有威吉特码。
$data.WebPhotoId {
max-width: 50px;
max-height: 50px:
}
dropdown-menu databind= {
max-width:50px;
max-height:50px;
body {
font-size: 16px;
font-family:Helvetica, Arial, sans-serif !important;
color: #676767;
}
如何将CSS放在此代码的前面,以更改菜单项的图片? enter image description here
好吧,如果将其设置为<img src="path/to/image">
,则不能很好地使用CSS。
在那种情况下,我建议为此使用JavaScript或jQuery。
var image = document.getElementsByClassName('image-class')
for(var i = 0; i < image.length; i++) {
image[i].src="path/to/new/image";
}
使用CSS可以设置background-image: url('path/to/new/image')
,但如果使用<img src="path/to/image">
设置图像,我认为它不起作用>