Grow your CSS skills. Land your dream job.

css help with backgrounds

  • # July 15, 2012 at 2:02 pm

    I am trying to make this background behind my h1 tags and have the background color as well behind the text. I am having trouble figuring out a way to accomplish this. Here is an image of what I need to accomplish

    so i will be setting up the repeating background behind the h1 tag. What I tried to do so far is have the repeating background on a span tag and then the background color on the h1. Problem is that the h1′s width is 100% and since I don’t know what the width will be, I can’t set a width on it. I want it so that it doesn’t matter what the width is. I need the text with the grey background color to sit on top of the diagonal repeating background.

    # July 15, 2012 at 2:10 pm

    figured it out. I put the span inside the h1 tag instead of outside, put the repeating background on the h1, and the background color on the span with display: inline-block;

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".