HTML: Uključite pozadinsku sliku - kako to radi
Pozadina HTML stranice ne mora biti jednobojna. Možete integrirati vlastite pozadinske slike i web lokaciju grafički učiniti individualnijom.
Uključite pozadinsku sliku pomoću atributa "style"
Pozadinsku sliku možete uključiti i u HTML bez korištenja CSS-a.
- Dajte atributu oznake tijela svoje HTML stranice.
- Naime atribut "stila".
- To izgleda ovako: "".
- U ovom slučaju datoteka "mein background.webp" trebala bi biti u istoj mapi kao i vaša HTML datoteka.
Zastarelo: atribut "pozadina"
I dalje možete koristiti atribut "pozadina". Ali nije dobar stil, da tako kažem, "zastario" je.
- Jednom dizajn nije izoliran od sadržaja.
- Na primjer, ovdje je korišten sljedeći kod: "".
Atribut "style" odnosi se na idejnu listu stila, odvajanje izgleda i sadržaja. Možete postići još elegantnije HTML programiranje ako dizajn i izgled zaista odvojite od sadržaja. To možete učiniti pomoću CSS-a. U drugom praktičnom savjetu objasnit ćemo razlike između HTML-a i CSS-a.