Kompx.com or Compmiscellanea.com


Aliosque subditos et thema


CSS nowrap


Preventing text wrapping by means of CSS: Preventing this text from wrapping HTML / XHTML. Code: <div class="nowrap">Preventing this text from wrapping</div> CSS. Code: .nowrap {white-space: nowrap;} Keeping text from wrapping using CSS - i.e. achieving the same effect as with HTML table cell nowrap attribute. Notes The default value for the white-space property - white-space: normal - brings text wrapping back. Adding <br /> into text overrides CSS command and makes the text to wrap at that point. [ 1 ] As well as Netscape 6.01+, Mozilla 0.6+. [ 2 ] As well as Netscape 6.01+, Mozilla 0.6+.

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