# Right align header not working

I'm trying to align my header to the right side but it is not going all the way to the right.

Here is a minimal example (I'm including my margins in case that is part of the problem? I honestly have no idea):

\documentclass[11pt]{article}

\usepackage{blindtext}
\usepackage{nopageno}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}

\textwidth=7in
\textheight=9.5in
\topmargin = -.25 in
\hoffset=-1in
\voffset=-0.5in
\parskip = 0.1in
\parindent = 0.0in

\begin{document}

\blindtext

\end{document}

• Use \usepackage{showframe} and you could see how wrong are your margins setup. Use geometry to setup margins. – Sigur May 14 '15 at 8:43
• @Sigur the geometry package was exactly what I needed, thank you so much! – a cast May 14 '15 at 8:54
• @a cast, Welcome! Use the search filed here on TEX.SE. There are many good examples. – Sigur May 14 '15 at 8:57

You should set \pagestyle{fancy} after having set the page parameters, because fancyhdr uses the current text width for preparing its headers and footers.

I recommend using geometry, though: probably

\usepackage[textwidth=7in,textheight=9.5in]{geometry}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}

Above all, never set \hoffset and \voffset: they are thought for making corrections in case the output driver needs them.