Kompx.com or Compmiscellanea.com

Renaming files in DOS

Operating systems : MS-DOS 6.0+ [ 1 ]

Renaming files in DOS by REN command

REN FILE1.TXT FILE2.TXT

- Renames FILE1.TXT into FILE2.TXT

REN FILE1.TXT FILE2.HTM

- Renames FILE1.TXT into FILE2.HTM

REN *.TXT *.HTM

- Renames all files with .txt extension into files with .htm extension. Only extensions are changed, the file names proper are left as they were.

Since REN is the shorter form of RENAME command, RENAME may be used instead - as more self-explaining may be.

Renaming files in DOS by MOVE command

MOVE FILE1.TXT FILE2.TXT

- Renames FILE1.TXT into FILE2.TXT

MOVE FILE1.TXT FILE2.HTM

- Renames FILE1.TXT into FILE2.HTM

Both methods of file renaming work in Windows command prompt as well. But there is a certain distinction: MS-DOS, other typical / older DOS'es, command prompt of Windows prior to Windows 95 and Windows NT 3.51 use a short filename / 8.3 filename convention. So, for example, REN FILE1.HTM FILE1.HTML is not going to work, there will be "Duplicate file name or file name not found" message. And that is not the case with newer DOS'es or command prompt of newer Windows. It can be not the case in older DOS'es also - if relevant drivers are installed.


[ 1 ]

MS-DOS 6.0+ tested - but it also may happen to work well under other versions of MS-DOS or other DOS'es.


Aliosque subditos et thema

 

CSS rollover. Changing background image position

 

CSS rollover. Changing background image position. Example: CSS rollover. Changing background image position HTML / XHTML. Code: <div class="example"> <a href="css-rollover-changing-background-image-position.htm">CSS rollover. Changing background image position</a> </div> CSS. Code: .example {position: relative; top: 0px; left: 0px; height: auto; width: 100%; white-space: nowrap; padding: 10px 20px 10px 20px;} .example a {height: 35px; width: 100%; font-size: 24px; line-height: 35px; color: #006; text-decoration: none; text-align: right; display: block; background: url("bgimg.png") no-repeat left top;} .example a:hover {color: #c00; background: url("bgimg.png") no-repeat left bottom;} Background image: CSS rollover Changing background image position The concept : 1. A link with width and height declared explicitly (here it is 100% and 35px), plus display: block - this makes a 100% by 35px rectangle, the whole area of which is a hyperlink. Line-height is declared explicitly as well, equal to the rectangle's height (35px here) - it helps to have the same vertical alignment of the link text across various web browsers. Text-align: right is added to move the link text to the right in the the link block. (The link block area is highlighted in green to make it more obvious) CSS rollover. Changing background image position 2. An image for the link block area background with height equal to two heights of the link block area is created. The image has two parts, the upper one and the lower one, each of height equal to the height of the link block area; here it is 35px. 3. The background image URL is added to the background CSS property of the link. The CSS background property values of no-repeat and left position the background image to the left of the link block area. The CSS background property value of top places the upper part of the background image on the same level as the link text. 4. The background image URL is added to background CSS property of the link's :hover pseudo-class. The CSS background property values of no-repeat and left of the link's :hover pseudo-class position the background image to the left of the link block area. The CSS background property value of bottom of the link's :hover pseudo-class places the lower part of the background image on the same level as the link text, when a user moves the mouse pointer over the link block area. So, when there is no mouse pointer over the link block area, the upper part of the background image is placed on the same level as the link text. When there is a mouse pointer moved over the link block area, the lower part of the background image gets on the same level as the link text. Mouse out - the upper part is displayed, mouse over - the lower part shows up. And no need to preload any additional images. CSS rollover.

CSS centering image

 

CSS horizontal centering of an image. Example: HTML / XHTML. Code: <div class="example"> <img src="image.jpg" alt="Image" /> </div> CSS. Code: .example {position: relative; left: 0px; top: 0px; height: auto; width: 100%; float: left; padding: 10px; border: 1px #ccc solid; background: #fafafa;} .example img {display: block; margin: 0 auto;} CSS properties of a container (here it is example) may vary, image centering is achieved by styles applied to the image itself: .example img {display: block; margin: 0 auto;}. [ 1 ] As well as Opera 4.0+, if shorthand CSS is not used in styles. That is, if it is .example img {display: block; margin-left: auto; margin-right: auto;}. [ 2 ] As well as Netscape 6.01+, Mozilla 0.6+. [ 3 ] As well as Netscape 6.01+, Mozilla 0.6+.