Kompx.com or Compmiscellanea.com

CSS centering image

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

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

CSS horizontal centering of an image. Example:

Image

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


Aliosque subditos et thema

 

Split video file. FFmpeg

 

Split video file by ffmpeg: There are two ways how to split video files by ffmpeg. The first one is good in itself, more than that - it is faster, but sometimes creates output files with certain flaws. So for those cases there is the second way of splitting video files: it is considerably slower, the output files are bigger, but it seems they are always of the same quality level as input files used. Way : 1 ffmpeg -ss <start> -t <duration> -i in1.avi -vcodec copy -acodec copy out1.avi Way : 2 ffmpeg -ss <start> -t <duration> -i in1.avi -sameq out1.avi - <start> - the beginning of the part of a video ffmpeg is to cut out. Format: 00:00:00 - hours:minutes:seconds - hh:mm:ss - <duration> - the duration of the part of a video ffmpeg is to cut out. Format: 00:00:00 - hours:minutes:seconds - hh:mm:ss Examples ffmpeg -ss 01:19:00 -t 00:05:00 -i in1.avi -vcodec copy -acodec copy out1.avi ffmpeg -ss 01:19:00 -t 00:05:00 -i in1.avi -sameq out1.avi - ffmpeg cuts out a part of the video file starting from 1 hour 19 minutes 0 seconds. The duration of the video sequence cut out is 5 minutes 0 seconds. About ffmpeg: ( Home page ) ( List of supported file formats and codecs )

Bold numbers in ordered lists

 

Numbers in an ordered list made bold without having any extra HTML tags added: List item List item List item HTML / XHTML. Code: <ol> <li>List item</li> <li>List item</li> <li>List item</li> </ol> CSS. Code: ol {counter-reset: item;} ol li {display: block;} ol li:before {content: counter(item) ". "; counter-increment: item; font-weight: bold;} There is no obvious way at the moment to style only numbers marking ordered list items. A workaround is to use a CSS counter instead of the default automatic numbering of ordered lists. The way a CSS counter is started allows to style specifically the marking numbers. Like in the example, where numbers in an ordered list are styled bold. This method also lets to use other characters after the numbers - besides dots. Like a parenthesis / round bracket instead of a dot. Or handling of space between the number, punctuation mark and the content proper of list item. [ 1 ] As well as Netscape 9.0+. [ 2 ] As well as Netscape 9.0+.