HTML: Включете фоново изображение - как работи
Свързани Видеоклипове: (Септември 2024).
Фонът на HTML страница не трябва да бъде монохромен. Можете да интегрирате свои собствени фонови изображения и да направите уебсайта си графично по-индивидуален.
Включете фоновото изображение с помощта на атрибута "стил"
Можете също така да включите фоново изображение в HTML, без да използвате CSS.
- Дайте атрибут на етикета на тялото на вашата HTML страница.
- А именно атрибут „стил“.
- Изглежда така: "".
- В този случай файлът "mein background.webp" трябва да бъде в същата папка като вашия HTML файл.
Остарял: атрибут "фон"
Все още можете да използвате атрибута "фон". Но не е добър стил, така да се каже, той е „оттеглен“.
- След като дизайнът не беше изолиран от съдържанието.
- Например тук е използван следният код: "".
Атрибутът „стил“ се отнася до идеята за стилов лист, разделянето на оформлението и съдържанието. Можете да постигнете още по-елегантно HTML програмиране, ако наистина отделите дизайна и оформлението от съдържанието. Можете да направите това с помощта на CSS. В друг практичен съвет ще обясним разликите между HTML и CSS.