Kompx.com or Compmiscellanea.com

CSS centering absolutely positioned elements

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

Linux : Firefox 1.0+, Google Chrome / Chromium, Opera 5.0+, SeaMonkey 1.0+ [ 2 ], NetSurf 2.6+.

CSS horizontal centering of an absolutely positioned element. Example:



<div class="example">

<img src="image.jpg" alt="Image" />


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+.

Aliosque subditos et thema




FTP in DOS. mTCP mTCP is a suite containing several utilities, one of which is FTP. It is similar to the FTP client of various Windows, running in Command Prompt. In order to install and use mTCP: 1. mTCP [ Home page ] 2. Packet driver for Ethernet network card: http://www.crynwr.com/drivers/ http://www.georgpotthast.de/sioux/packet.htm 3. Create a folder, for example C:\DRIVERS\. Put there: a packet driver for Ethernet network card. 4. Set up network. For example, by means of Microsoft Network Client 3.0 [ How-to page ] 5. Start packet driver. In the case discussed it is: C:\DRIVERS\PCIPKT.COM 0x60 6. Unpack the archive with mTCP into a folder, C:\SOFT\MTCP for instance, and create a tcp.cfg file in it with the strings: PACKETINT 0x60 HOSTNAME FTP_IN_DOS The value of PACKETINT - the interrupt number used in the packet driver starting. The value of HOSTNAME - any. 7. Start DHCP.EXE (DHCP will set up mTCP for work with the network): DHCP 8. Start FTP: FTP [ FTP address / host ] There will be a prompt for a name, after that - the password. Next, it is better to switch to passive mode: XFERMODE PASSIVE [ The list of the main commands supported by FTP of mTCP is available in ftp.txt, included in mTCP suite archive ] To exit: QUIT mTCP - GNU GPL v3.

Non-breaking space ( &nbsp; ) in :before and :after content


Non-breaking space ( &nbsp; ) in :before and :after pseudo-elements. Hex code ( \00a0 ) is used in the content property instead of the named character entity ( &nbsp; ). Example: ABC HTML / XHTML. Code: <div>ABC</div> CSS. Code: div:before {content:"\00a0";} div:after {content:"\00a0";} /* Extra CSS to make non-breaking spaces more obvious here: */ div:before {height: 1em; width: 1em; display: inline-block; background: #f00;} div:after {height: 1em; width: 1em; display: inline-block; background: #00f;} [ 1 ] As well as Netscape 6.01+, Mozilla 0.6+. [ 2 ] As well as Netscape 6.01+, Mozilla 0.6+.