Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to style h1 element inside php?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #239107
    nootkan
    Participant

    Trying to style my text on a php page using css and having trouble figuring it out. Here is my code:

    “`<div class=”row”>

    <div class="large-2 columns"> </div>

    <div class="large-8 columns">
    <br />
    <h1 class="404page">
    <?php _e("Holy moly, you found our black hole! How did you accomplish that? It was supposed to be classified!", 'ctg_classifieds') ; ?>
    </h1>
    <h3 class="404page">
    <?php _e("You should have been shown to the unclassified section. Let us help you, we have got a few tips for you to find it.", 'ctg_classifieds') ; ?>
    </h3><br /><br /><br />
    </div>

    “`

    I tried these styles:
    h1.404page {color:#fff; text-shadow: 0em .063em .063em #008cba;}
    .404page h1 {color:#fff; text-shadow: 0em .063em .063em #008cba;}

    Neither worked. Any help is greatly apprectiated.
    Also I tried to use CodePen but couldn’t figure out how to use it properly.

    #239110
    Ilan Firsov
    Participant

    Classes can’t start with a number, change it to something like page-404 and it will work. Your CSS selector would look like this: .page-404 or h1.page-404.

    #239135
    nootkan
    Participant

    Thanks for your reply. That didn’t work in my custom css however so I just added this to the head tags inside the actual header2.php file and it seems to work. Not sure what I am doing wrong.

    &lt;style&gt;
    h1.page-404 {color:#fff;text-shadow:0em .063em .063em #008cba;font-weight:900;}
    &lt;/style&gt;
    &lt;style&gt;
    h3.page-404 {color:#fff;text-shadow:0em .063em .063em #008cba;font-weight:900;}
    &lt;/style&gt;

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.