Float right inside a container in HTML and CSS
Description
The following code shows how to float right inside a container.
Example
<html>
<head>
<style type="text/css">
.container{<!--from ww w .j ava2 s.com-->
position: relative;
width: 800px;
height: 800px;
background: pink;
}
.box {
float: right;
overflow: auto;
visibility: visible;
width: auto;
height: 100px;
margin: 10px;
padding: 10px;
background: red;
}
.small {
position: absolute;
border-left: 10px dotted black;
background: yellow;
}
</style>
</head>
<body>
<div class="container">
<div class="small">this is a test. <BR/>this is a test. this is a test. this is a test. </div>
<div class="box">this is a test</div>
</div>
</body>
</html>
The code above generates the following result.
HTML CSS Tutorial Float
Create columns floating left in HTML and CS...
Float div left with width and height settin...
Float left and right for three columns layo...
Float left and right with other content in ...
Float left in HTML and CSS
Float right in HTML and CSS
Use floating elements to create columns in ...
Create columns floating left in HTML and CS...
Float div left with width and height settin...
Float left and right for three columns layo...
Float left and right with other content in ...
Float left in HTML and CSS
Float right in HTML and CSS
Float right inside a container in HTML and ...
Make list item float left in HTML and CSSUse floating elements to create columns in ...