Question

Photo of Ken Roach

0

How do you build on a style in HTML?

Newbie HTML question:  If I want to create a new <p> style - but based on the default <p> style, for example, a style <p2> that is based on <p> but with grey bold text - how would I do that?  Do you just create the new style, then embed the <p2></p2> within the <p></p>?  E.g.

<style>

p2 {color:#808B96; font-weight: bold;}

</style>


What is the difference between the Page Header Content and the Block Properties Advanced Settings Pre HTML?  






  • Photo of Scott Willis

    1

    Hi Ken,

    I'm sure there are many ways to tackle the HTML question. Here's one - obviously replacing the colors...

    <style>
    p {
        color: blue;
    }
    
    p.style2 {
        color: green;
        font-weight: bold;
    }
    </style>
    
    <p>This is blue.</p>
    <p class="style2">This is green and bold.</p>
    • Ken Roach

      Thanks Scott!


      The <style></style> code can go in the theme's CSS file (site wide change)
      OR
      the page properties block, Advanced Settings, Header Content (page wide change)
      OR
      the HTML Block Properties, Advanced Settings, Pre-HTML (block wide change)
      OR
      even in the HTML block itself (HTML block wide change).