1. ホーム
  2. css

[解決済み] Define an <img>'s src attribute in CSS [duplicate]

2022-03-11 02:11:49

Question

I need to define an <img>'s src attribute in CSS. Is there a way to specify this attribute?

How to solved?

#divID {
    background-image: url("http://imageurlhere.com");
    background-repeat: no-repeat;
    width: auto; /*or your image's width*/
    height: auto; /*or your image's height*/
    margin: 0;
    padding: 0;
}