-1

Generally we use this style

body {
  background-image:url("../image/paper.png");
  background-repeat: repeat;
  background-color: #cccccc;
}

is it possible like this?

body {
  background-image:src("../image/paper.png");/* want to use src attribute to get image */
  background-repeat: repeat;
  background-color: #cccccc;
}
cloned
  • 6,346
  • 4
  • 26
  • 38
  • What would be the point of that? And why `src`, why not `foobar`? And why don't we "rename" `background-image` to `akfxdh-jshsdh`, while we're at it ...? No, you can not use whatever you like, when you are working within a system that has a defined syntax & keywords. – CBroe Aug 23 '22 at 07:42
  • I've to send attachment via email and using src attribute(e.g image – Azharul Islam Aug 23 '22 at 08:28
  • You are conflating two different things here. Adding your image file as an attachment to your email, is one thing. _Referring_ to that attached file, to use it as an image (or background image) inside the HTML mail body, is another. But the syntax for the latter is different, you don't use normal relative URLs there; your attachment needs a "content id", and that needs to be referred as image source then, https://stackoverflow.com/questions/6706891/embedding-image-in-html-email – CBroe Aug 23 '22 at 09:56

1 Answers1

1

Big NO. You can't it is out of css standard

Visit : https://developer.mozilla.org/en-US/docs/Web/CSS/background-image