Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
vik96 каза:Как с js да сменя фона на страницата?
така не става :?Код:<script>document.body.style.background='url(b.jpg)'; </script>
Пробвай така и имай предвид, че ако просто го плеснеш в script няма да стане. Или във функция или в някакъв onload eventdocument.body.style.backgroundImage = "b.jpg";
Еми? Как трябва да стане за да работи?devent каза:Пробвай така и имай предвид, че ако просто го плеснеш в script няма да стане. Или във функция или в някакъв onload eventdocument.body.style.backgroundImage = "b.jpg";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function fona()
{
document.body.bgColor="#000000";
}
window.onload=fona;
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function fona()
{
document.body.style.background="url('картинка')";
}
window.onload=fona;
</script>
</head>
<body>
</body>
</html>
БлагодарскоFRGT10 каза:Горното е за цвят, това за изображение.
Код:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> function fona() { document.body.style.background="url('картинка')"; } window.onload=fona; </script> </head> <body> </body> </html>