Html: image in background?

Hi, I need help with HTML (only HTML and not CSS).

I want to insert an image, but I don't want it to be in the text, but rather behind the text.

When it's in the text, everything shifts and there's a huge gap between the lines, which is exactly what I want to avoid.

Can anyone help me?

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
 Mirko Marek
10 months ago

Hi,

what you would like to have with CSS only. At least when it comes to the HTML5 standard. If you want a background image for an element, parent element or for the whole page, you need the following CSS code:

.meinElement {
  backgound-image: url("../images/meinBild.jpg");
}

For the whole body you can also use this:

body {
  background-image: url("../images/meinBild.jpg");
}

You can also find further information about Adding Background Graphics in the Selfhtml wiki under: https://wiki.selfhtml.org/wiki/CSS/Tutorials/Hintergrund/Gestalungs_mit_CSS

or a tutorial for CSS under:

https://wiki.selfhtml.org/wiki/CSS/Tutorials/Einstieg

Success

Seliba
10 months ago

You can set a background image by setting the “background” attribute of the body tag, such as:

 

Or do you just want to write a certain text on a picture?

medmonk
10 months ago
Reply to  Seliba

The “background” Attribute is outdated, not part of the HTML5 specification and should not be used alone anymore. Therefore, as Mirko has already written correctly, background graphics should be integrated via CSS.

Seliba
10 months ago
Reply to  medmonk

Thanks for the hint