# Usage of \caption command in converting LaTeX files to HTML using tex4ht

Hi I'm new to LateX and Tex4ht. So please bear with my inexperience.

I am required to convert LaTeX source files into HTML (I further require to compile them into .chm files; I have decided to first work on the HTML output and then worry about the chm part)

My source includes pictures and I have used the \caption command to provide the necessary captions. The MWE is:

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=\linewidth,keepaspectratio]{figs/figure1.png}
\end{center}
\caption{Startup Screen}
\end{figure}


On running the pdflatex command from command prompt I get accurate .pdf files but when I run the htlatex command the caption is skewed to the left of the .html formed.

Any help would be great..! Thanks

You can configure appearance with css instructions in the custom config file.

Try this, name the file myconf.cfg:

\Preamble{xhtml}
\Css{div.caption{text-align:center;}}
\begin{document}
\EndPreamble


Important line is \Css{div.caption ...} whis is css instruction to center the text, div.caption is element generated by tex4ht for \caption commands.

htlatex filename "myconf"