Kompx.com or Compmiscellanea.com

Float bottom

Windows : Internet Explorer 8.0+, Firefox 1.0+, Google Chrome, Opera 7.5+, Safari 3.1+, SeaMonkey 1.0+ [ 1 ].

Linux : Firefox 1.0+, Google Chrome / Chromium, Opera 7.5+, SeaMonkey 1.0+ [ 2 ], Hv3.

There is no "float: bottom" in CSS, but there is a way to achieve it by some other means. Example:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Float bottom

HTML / XHTML. Code:

<div class="box1">

<div class="content1">

<div class="left1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>

<div class="menu1">

<p><a href="#">Link 1</a></p>

<p><a href="#">Link 2</a></p>

<p><a href="#">Link 3</a></p>

</div>

</div>

<div class="bottom1">Float bottom</div>

</div>

CSS. Code:

.box1 {position: relative; top: 0px; left: 0px; float: left; height: auto; width: 100%;}

.content1 {position: relative; top: 0px; left: 0px; float: left; height: auto; width: 100%;}

.left1 {position: relative; top: 0px; left: 0px; float: left; height: auto; width: 64%;}

.menu1 {position: relative; top: 0px; left: 0px; float: left; height: auto; width: 36%;}

.bottom1 {position: absolute; bottom: 0px; right: 0px;}

/* Extra CSS, just styling the look */

.box1 {color: #ddd; text-align: center;}

.content1 {background: #bbb;}

.left1 {min-height: 100px; padding: 2%; text-align: justify; background: #006; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box;}

.menu1 {padding: 2%; float: right; background: #060; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box;}

.menu1 p {position: relative; top: 0px; left: 0px; float: left; height: auto; width: 100%; padding: 0px; margin: 0px;}

.menu1 a {color: #ddd; text-decoration: none;}

.menu1 a:hover {text-decoration: underline;}

.bottom1 {padding: 2%; color: #eee; background: #600;}

There is a web page with a div box, containing its content - box1. There are two div boxes inside it:

1. "content1" with the content proper on the left and menu on the right.

2. "bottom1" after the content1. It is to be positioned visually inside content1, at its lower edge and stay there in the same place even if the content1 height changes. That is, as if to be of "float: bottom" within content1.

"Position: absolute" and "bottom: 0px" place bottom1 at the lower edge of content1. Here in the example the menu block of the page content is on the right, so bottom1 has to be also floated right - this is done by "right: 0px". Would the menu block be on the left in the content, bottom1 could be floated left by "left: 0px".


[ 1 ]

As well as Netscape 7.2+, Mozilla 1.5+.

[ 2 ]

As well as Netscape 7.2+, Mozilla 1.5+.


Aliosque subditos et thema


CSS centering absolutely positioned elements


CSS horizontal centering of an absolutely positioned element. Example: HTML / XHTML. Code: <div class="example"> <img src="image.jpg" alt="Image" /> </div> CSS. Code: .example {position: relative; left: 0px; top: 0px; height: 90px; width: 100%; float: left; padding: 10px; border: 1px #ccc solid; background: #fafafa; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box;} .example img {position: absolute; left: 0px; right: 0px; margin: 0px auto; width: 68px;} An absolutely positioned img is centered in the example. But this method of horizontal centering also works with other both inline and block absolutely positioned elements. The width of an absolutely positioned element may also be in percent or other units. CSS properties of a container (here it is .example), holding an element to be centered, may vary. The element's centering is achieved by styles applied to the element itself: .example img {position: absolute; left: 0px; right: 0px; margin: 0px auto;}. [ 1 ] As well as Netscape 8.01+, Mozilla 1.5+. [ 2 ] As well as Netscape 8.01+, Mozilla 1.5+.

Renaming folders in DOS


Renaming a folder in DOS by MOVE command: MOVE FOLDER1 FOLDER2 - Renames FOLDER1 into FOLDER2 The method works in Windows command prompt as well. [ 1 ] MS-DOS 6.0+ tested - but it also may happen to work well under other versions of MS-DOS or other DOS'es.