Forums

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

Home Forums CSS [Solved] Add background to title in header

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

    Hello,
    how to add some background to title in header of my page? I’d like to highlight only the title, not the whole div.
    http://wrozbita.warszawa.pl/tarot/
    Thanks!

    #209815

    Try this:

    .title {
      text-align: center;
    }
    .title h1 {
      display: inline-block;
      margin-top: 100px; // or something to push it down, may need to adjust
      padding: 20px; //however much border you need around the title
      background: rgba(0,0,0,0.5); //whatever background color you want
    }
    

    Also, make sure to remove all the absolute positioning and 100% width that are currently on the .title h1 selector.

    #209881
    gombroo
    Participant

    Works very well, thank you! :)

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