Kompx.com or Compmiscellanea.com


Aliosque subditos et thema


CSS horizontal and vertical centering - 2


Centering the content of a web page in the viewable area of a browser by means of CSS. A box to contain the whole content of the page is CSS centered horizontally and vertically: [ Open demo page ] HTML / XHTML. Code: <!DOCTYPE html> <html> <head> <title>CSS horizontal and vertical centering - 2</title> <link rel="stylesheet" type="text/css" href="css.css" /> </head> <body> <div class="spacer">&nbsp;</div> <div class="wrapper"> <div class="pagecontent">&nbsp;</div> </div> </body> </html> CSS. Code: html {height: 100%; margin: 0px;} body height: 100%; margin: 0px;} .spacer {position: relative; top: 0px; left: 0px; height: 50%; width: 100px; float: left; margin: 0px 0px -250px 0px; background: #999;} .wrapper {position: relative; top: 0px; left: 0px; height: 500px; width: 100%; clear: both; background: #a3ddc4;} .pagecontent {position: relative; top: 0px; left: 0px; height: 500px; width: 800px; margin: 0 auto; background: #ff6f6f;} The .pagecontent box is for the page content. It must be of a fixed height and width in units like px's or em's - not in percents. Height and width may be larger than web browser viewable area, but here the more practical case is discussed - when the height and width of .pagecontent are smaller than those of the web browser viewable area. The .pagecontent box is horizontally centered by its "margin: 0 auto". .Wrapper creates a space where .pagecontent is centered horizontally. .Wrapper's width is 100% for centering at various web browser viewable area sizes. The height has to be equal to the one of .pagecontent. .Spacer centers .wrapper with .pagecontent in it vertically inside browser viewable area. Its width may be any. The height is 50% - that places the top edge of .pagecontent vertically in the middle of the browser viewable area. The bottom margin of .spacer equal to half the .pagecontent height centers .pagecontent and its contents vertically in the web browser viewable area of a current height. This method is reliable in all major modern web browsers. It also works in older browsers like Internet Explorer 6 or earlier versions of Maxthon. But the height of box for page content has to be assigned explicitly and if it is changed - the size of .spacer bottom margin must be changed accordingly as well. There is another way of CSS horizontal and vertical centering, with CSS code easier to maintain, even if not suitable for older web browsers: CSS horizontal and vertical centering - 1. [ 1 ] As well as Netscape 7.2+, Mozilla 1.5+. [ 2 ] As well as Netscape 7.2+, Mozilla 1.5+.



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.