Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CSS to align page title center width

Can anyone see what I’m missing. I’m just trying to align the page title center width. However, nothing works. The h1 element doesnt to go to 100% width of its parent container (really the browser width), no matter what I try (I’ve tried 20 different combinations of values)…

.ast-archive-description {
    background: #000000 !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
    width: 100% !important;
}
.ast-archive-title {
    text-align:center !important;
    color: #FFCC00 !important;
    width: 100% !important;
}

It’s on this page:
https://holyspiritprints.com/category/fine-art-prints/sweet-psalms-arizona/

Thanks kindly for what I’m doing wrong. 🤷‍♂️

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

After scraping about a bit in your page, I have noticed a lot of rule overriding (where the rule is crossed out). This should be avoided as it makes it hard to see what rules apply where as well as adding unneccary css. The offending rule here is this:

body.archive .ast-archive-description {
    max-width: 1200px;
}

Disabling it centeres the text.
If editing this css isn’t an option you can override it to unset

body.archive .ast-archive-description {
    max-width: unset !important;
}

Also note that you have included the same CSS file twice (I don’t know if this is wordpress’ fault)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading