How to Set the CSS Class in a Sitecore FieldRenderer

Today I was trying to set the CSS class of a Sitecore FieldRenderer tag. I tried in different ways, using the CssClass attribute, both directly in the sc:FieldRenderer tag and from the codebehind. Didn’t work. Finally I found a post that explains that the correct way is the following:

<sc:FieldRenderer runat="server" ID="myRenderer"
    Parameters="class=myCSSClass" FieldName="My Field" />