Forums

Using of different font-weight in headings (6 posts)

  1. einar_
    Member
    Posted 1 year ago #

    I want to alternate between normal and bold font-weight in my h1.
    (This is an example)
    Is this possible? How do I do then?
    I work with pages (not posts), and use Page title as h1.

    Cheers,

    Björn

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Create a custom page template that uses a different class on the h1 tag. You can then style the new class differently in your stylesheet and apply the new page template as required.

  3. einar_
    Member
    Posted 1 year ago #

    I think I have to change something in this code -
    <h1 class="entry-title"><?php the_title(); ?></h1>
    I can't change this class to be both bold and normal, and I can't use two classes to establish this "effect" in same h1-tag.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Use something like:

    <h1 class="alt"><?php the_title(); ?></h1>

    and then style using something like:

    h1.entry-title,h1.alt{
    [ current styling goes here ]
    }
    h1.entry-title {font-weight:normal;}
    h1.alt {font-weight:bold};
  5. einar_
    Member
    Posted 1 year ago #

    I'm not good explaining the problem - I write it in static HTML instead, just for an example:

    <h1>This is normal font-weight, and <span style="font-weight:bold;>this is bold.</span></h1>

    And the h1 will then look like:
    This is normal font-weight, and this is bold.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try reading what I suggested above.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags