1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

adjusting background image for header

Discussion in 'CSS' started by driven, Aug 28, 2008.

  1. #1
    this is my site here.

    is there a way to adjust the teal splash background image for the headers so that it will adjust in accordance to the character length of the header?

    for example, if you take the h2 or h3 headers, is there a way to shrink the image so that it is only as wide as the header itself?
     
    driven, Aug 28, 2008 IP
  2. Thomas_Horton

    Thomas_Horton Member

    Messages:
    163
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    35
    #2
    You mean the header text right?

    Just put in the css of the H2

    width: auto;

    It could also use some padding-top.

    Thomas
     
    Thomas_Horton, Aug 29, 2008 IP
  3. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I like to float em and add some padding. But you can't change the size of the image itself only what part shows. So it will only display half or w/e the lenght of the text is. You can also change the font size of all h's to be the same height...
     
    007c, Aug 29, 2008 IP
  4. driven

    driven Well-Known Member

    Messages:
    400
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    138
    #4
    007-I'm not sure I understood what you were saying. Are you saying that adding padding will help determine the length of the background image? I tried that and it didn't work.
     
    driven, Aug 29, 2008 IP
  5. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You need to add the background to the h2 class, i'd add padding to the h2 also so the background shows more each side of the h2 text.
     
    007c, Aug 29, 2008 IP
  6. driven

    driven Well-Known Member

    Messages:
    400
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    138
    #6
    he image was already added to the h2 way before hand so I don't know what you are referring to;

    h1, h2, h3, h4, h5, h6 { 
    	color: #000000;
    	margin: 0 0 10px 0;
    	background: transparent url(images/bg_h2.png) no-repeat left center;
    	width: auto;
    	height: 38px;
    	}
    
    Code (markup):
     
    driven, Aug 29, 2008 IP
  7. mypsdtohtml

    mypsdtohtml Guest

    Messages:
    96
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    adding a background is:

    background-image: url ("mysite.com");
     
    mypsdtohtml, Aug 30, 2008 IP
  8. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I meant something like that here note its a quick whipup. Din't really check your code...
     
    007c, Aug 31, 2008 IP