I'm a coding beginner who just started html. I declared a class and declared a class to put an image on the input column, but it does not apply. It only applies to the wrong code What is the problem?
<head>
<style type="text/css">
.search {
position: relative;
width: 300px; }
input {
width: 100%;
border: 1px solid #bbb;
border-radius: 8px;
padding: 10px 12px;
font-size: 14px; }
img {
position : absolute;
width: 17px;
top: 10px;
left: 120px;
margin: 0; }
</style>
<img src = "wikipidia-main.jpg" style = "width: 20em; height: 5em;" alt = "위키백과">
<div class="search">
<input type="text" placeholder="Enter search terms">
<img src="search_top_en_US.gif">
</div>
</head>
Would you like to try this?
/* Apply the following rule to the img element in the element with the .search class */
.search img {
position : absolute; /* or less omitted */
}
By the way, the head is too big! It's a very deformed child to have an image inside the head and a body inside the input space. Move </head>
directly behind </style>
and wrap the rest with <body>
tags.
© 2024 OneMinuteCode. All rights reserved.