Can I replace the maxlength attribute with something in CSS?
No. This needs to be done in the HTML. You could set the value with Javascript if you need to though.