'Having trouble positioning images in my Webpage using CSS
Could someone please take a look at my CSS Style Sheet and inform me where my mistake is? Anything I do to my img.otherimages selector, nothing happens and the image stays in the same position, on the bottom of the Webpage. Is there another selector I have that's dominating over this one?
body{
zoom:0.8;
width:800px;
height: 600px;
}
h1 {
margin: 50px 100px 10px 65px;
color: #92CD00;
font-size: 26px;
text-align:center;
width:380px;
}
.menubar{
height:30px;
padding:4px;
border: 50px
font-size: 18px;
overflow:hidden;
color: #ffffff;
background: rgb(137,193,11);
background: linear-gradient(180deg, rgba(137,193,11,1) 35%, rgba(108,155,47,1) 100%);
}
.menubar a {
margin-left:0;
float:left;
display: inline;
color: #ffffff;
text-align: center;
padding-left:10px;
padding-right: 10px;
text-decoration: none;
}
.menubar a:hover {
background-color: #81b518;
color: #ffffff;
}
p ,ol, div.paragraph{
float:left;
width: 50%;
line-height:1.4;
margin:10px;
padding: 10px;
display:block;
text-align:justify;
height:420px;
font-family:Verdana,serif;
color:#192402;
}
img.otherimages {
object-position: right top;
position:relative;
right: 0;
float:right;
width: 50%;
margin: 0 0 10px 10px;
padding: 10px;
height:420px;
}
img#leaf{
position: absolute;
top:-40px;
height: 120px;
font-size: 18px;
}
footer{
clear:both;
position:static;
height: 30px;
background-color: #81b518 ;
text-align:center;
display: flex;
justify-content: center;
font-size:18px;
color:#ffffff;
align-items: center;
}
Here's the HTML:
<!DOCTYPE html>
<html lang="mkd">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="CssStyleSheet.css"/>
<title>Најава</title>
</head>
<body>
<div class="menubar">
<a href="index.html">Дома</a>
<a href="servisi.html">Сервиси</a>
<a href="zanas.html">За нас</a>
<a href="kontakt.html">Контакт</a>
<a href="najava.html">Најава</a>
<img id="leaf" src="Images/leaf.png" alt="leaf">
</div>
<h1><b>Најава</b> </h1>
<p>
<span style="text-decoration:underline">Оваа опција моментално не е достапна.</span><br/>
Доколку сакате да контактирате со нас информации можете да најдете во табот
<span style="text-decoration:underline; background-color:yellow"> Контакт. </span>
</p>
<img src="Images/computer.jpg" alt="Computer Screen"/>
<footer>
©Веб Дизајн
</footer>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
