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

Home Forums CSS [Solved] Creating a dynamic underline for a heading

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #27652

    I am working on a design and want to create an underline background for a heading which can expand or shrink depending on the heading.


    The code for the heading is <h1><img(the stars in front which is inserted using jQuery)/>The Wahine Disaster<img(second stars at right)/></h1> . What is the best way to do this?


    You can actually apply a background to H1 elements. You can style them just like you would a div.


    How do I get the H1 to fit tight to the text and also center the heading in the middle of the page?


    I’m not sure what you mean by "fit tight to the text", but you can apply a height to h1.

    Do you have a link of where you’re working on it?



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