# Change horizontal line color on top of footer

I would like to change the colour of the horizontal line directly above the footer. I have referenced this question and copied the relevant code below. This successfully changes the color of the horizontal line at the bottom of the header. However, I am unable to manipulate it to change the color of the line at the top of the footer.

  \renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\headrule}{\hbox to\headwidth{\color{mycustomcolor}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrulewidth}{0.5pt}


I tried changing the \headrule to \footrule in the second line but it did not work and I do not have a solid understanding of how to make the correct changes to apply it to the footer.

Any help is greatly appreciated, thanks.

• Using the code in Werner's answer to the linked question and changing \headrule to \footrule works for me – user31729 Jun 15 '17 at 14:41

## 1 Answer

This works....

\documentclass{article}

\usepackage{xcolor}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\headrule}{\hbox to\headwidth{\color{red}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrulewidth}{0.5pt}
\renewcommand{\footrule}{\hbox to\headwidth{\color{red}\leaders\hrule height \footrulewidth\hfill}}
\pagestyle{fancy}

\begin{document}
hello
\end{document}

• This seems to change the position of the separator, though? (the vertical space between the header and the line is larger) – Rastapopoulos Mar 14 at 17:52