import os with open('src/main/resources/static/css/custom.css', 'r') as f: css = f.read() # Replace max-width: fit-content with max-width: 100% or remove it css = css.replace("max-width: fit-content;", "max-width: 860px;") # 860px is the width in their snippet, but 100% is better. # In their snippet they have a parent