تسجيل الدخول | التسجيل | الأسئلة المتكررة
Anonymous

Changing an image in HTML using CSS?

+ إضافة رد

3 مشاركة صفحة 1 من 1


Changing an image in HTML using CSS?

بواسطة SnivyDroid » الخميس إبريل 13, 2017 8:41 pm

I'm currently creating a style for a website using stylish, a google chrome plugin.
One of the things i wanted to do was change the image of some elements for the theme im creating.
But i only recently found out that the image is coded into html with the img tag, not CSS as a background or background-image property.
Stylish only allows you to use CSS when coding styles,
and as far as i know, you cannot edit html with CSS,

So how could i change a image that is coded in html with CSS? If at all?
صورة العضو الشخصية

SnivyDroid

  • مشاركات: 1
  • اشترك في: الخميس إبريل 13, 2017 8:35 pm

Re: Changing an image in HTML using CSS?

بواسطة Eigerstand » الجمعة أغسطس 25, 2017 8:38 am

You can not change img src with css, you can do that with javascript. If you want you can make the image as background to element and then change it with css background-image property.
صورة العضو الشخصية

Eigerstand

  • مشاركات: 5
  • اشترك في: الجمعة أغسطس 25, 2017 8:07 am

Re: Changing an image in HTML using CSS?

بواسطة typomaniac » الجمعة سبتمبر 01, 2017 7:53 pm

You can do mouseovers with CSS Problem with depending of javascript is the fact that your client (visitor) could have disabled javascript in his browser. I googled your situation and found a site you should look at. http://www.corelangs.com/css/box/hover.html should be able to answer your questions. You would truly be amazed at what you can find by googling.
صورة العضو الشخصية

typomaniac

  • مشاركات: 2
  • اشترك في: الاثنين أغسطس 21, 2017 1:34 pm


+ إضافة رد

صفحة 1 من 1