Помогите с кодом для сайта - Вебмастеринг

Вопрос Помогите с кодом для сайта

Регистрация
29 Июн 2013
Сообщения
90
Репутация
0
Спасибо
0
Монет
0
Почему код не работает для сайта который вот что выдает на него и вот код <!DOCTYPE html>

<html lang="ru">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Ты будешь моей девушкой?</title>

<style>

body {

text-align: center;

font-family: Arial, sans-serif;

background-color: #ffe4e1;

transition: background 0.5s;

}

.container {

margin-top: 50px;

}

.bear {

width: 200px;
317631101_e812abd064d1a885045020c5636bb8ad_800.jpg

 
Регистрация
5 Авг 2013
Сообщения
73
Репутация
0
Спасибо
0
Монет
0
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ты будешь моей девушкой?</title>
<style>
body {
text-align: center;
font-family: Arial, sans-serif;
background-color: #ffe4e1;
transition: background 0.5s;
}
.container {
margin-top: 50px;
}
.bear {
width: 200px;
/* Здесь можно добавить дополнительные стили, например: */
height: auto;
margin: 20px auto;
}
</style>
</head>
<body>
<div class="container">
<h1>Привет!</h1>
<p>Ты будешь моей девушкой?</p>
<img src="bear.jpg" alt="Милый медведь" class="bear">
</div>
</body>
</html>
 
Регистрация
25 Апр 2013
Сообщения
99
Репутация
0
Спасибо
0
Монет
0
Код, который в вопросе и код, который на скрине - два разных кода.
 
Регистрация
14 Дек 2012
Сообщения
71
Репутация
0
Спасибо
0
Монет
0
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ты будешь моей девушкой?</title>
<style>
body {
text-align: center;
font-family: Arial, sans-serif;
background-color: #ffe4e1;
transition: background 0.5s;
}
.container {
margin-top: 50px;
}
.bear {
width: 200px;
}
.buttons {
margin-top: 20px;
}
button {
padding: 10px 20px;
font-size: 18px;
margin: 10px;
cursor: pointer;
border: none;
border-radius: 5px;
transition: 0.3s;
}
.yes {
background-color: #4CAF50;
color: white;
}
.no {
background-color: #f44336;
color: white;
position: absolute;
}
</style>
</head>
<body>
<div class="container">
<h1>Ты будешь моей девушкой?</h1>
<img src=" alt="Мишка" class="bear">
<div class="buttons">
<button class="yes" onclick="alert('Ура! ?')">Да</button>
<button class="no" onmouseover="moveButton()">Нет</button>
</div>
</div>

<script>
function moveButton() {
let button = document.querySelector('.no');
let x = Math.random() * (window.innerWidth - button.offsetWidth);
let y = Math.random() * (window.innerHeight - button.offsetHeight);
button.style.left = x + 'px';
button.style.top = y + 'px';
}
</script>
</body>
</html>
 
Сверху Снизу