Reputation: 21
I am having trouble positioning a div to the right side of the screen. here is my code snippet. for html
<div id="bannerR">
<a href="google.comtarget=_blank>
<img src="google.com" border=0></a>
</div>
and here is what i have for .css
#bannerR { position: relative; right; }
please help. thank you
Upvotes: 1
Views: 11167
Reputation: 1
<html>
<head>
<style>
.container{
border: 1px solid blue;
text-align: right;
}
.logo{
border: 1px solid red;
background-color: gray;
display: inline-block;
padding: 15px;
}
</style>
</head>
<body>
<hr>
<div class="container">
<div class="logo">
LOOOGO
</div>
</div>
<hr>
</body>
</html>
Upvotes: 0
Reputation: 8161
There is no valid CSS property like this : position: relative; right;
.
If you want to move Element to right side. You can use CSS float
property.
CSS:
#bannerL {
position: relative;
float: right;
}
Upvotes: 0
Reputation: 2896
So here is the working code:
HTML:
<div id="bannerL">
<center>
<a href="http:google.com">
<img src="google.com" width="468" height="60">
</a></center>
</div>
CSS:
#bannerL{ position: relative; float:right; }
Live Demo: http://jsfiddle.net/M2smA/1/
Upvotes: 0
Reputation: 9460
Check out this fiddle http://jsfiddle.net/dd63m/14/ for Live Demo
<style>
#bannerL{ position: relative;
float:right; }
</style>
<div id="bannerL">
<a href="http:google.com">
<img src="google.com"
width="468" height="60">
</a>
</div>
Hope this helps
Upvotes: 0
Reputation: 2157
Html:
<div id="bannerL">
<center>
<a href="http:google.com">
<img src="google.com"
width="468" height="60">
</a></center>
</div>
css:
#bannerL{ position: relative; right:0; top:0; }
Upvotes: 0
Reputation: 3964
#bannerL
{
position: relative;
float: right;
}
add float: right;
Upvotes: 1
Reputation: 3067
float: right; in the css should do the trick
#bannerL { position: relative; float: right; }
Upvotes: 0