How can i have a background color or image for this code!

Discussion in 'HTML & Website Design' started by Ojasvi Bhargava, Oct 29, 2010.

  1. #1
    Here is the code for what i need to have background image in line:
    I think need to add some tags like things but i know about it.
     
    Ojasvi Bhargava, Oct 29, 2010 IP
  2. pep1439

    pep1439 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use styles for this :(image)

    <center style="background-image: url(http://www.onlinetut.com/tutorial/images/middle_logo.gif);"><a href='http://cricketfame.blogspot.com/p/contact-us-name-email-subject-message.html'>Contact Us</a> | <a href='http://cricketfame.blogspot.com/p/disclaimer.html'>DMCA Disclaimer and Privacy Policy</a> | <a href='#header'>Back To Top</a></center>
    Code (markup):

    and for color :

    <center style="background:cyan;"><a href='http://cricketfame.blogspot.com/p/contact-us-name-email-subject-message.html'>Contact Us</a> | <a href='http://cricketfame.blogspot.com/p/disclaimer.html'>DMCA Disclaimer and Privacy Policy</a> | <a href='#header'>Back To Top</a></center>
    Code (markup):
    resul
    source:http://www.onlinetut.com/tutorial/css/background_css.jsp:cool:
     
    pep1439, Oct 30, 2010 IP
  3. S1M

    S1M Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    pep1439 almost got it. You need to wrap your content in a div and add a background style to that. Replace the 'center' tag with 'div' and that should work for you.
     
    S1M, Oct 30, 2010 IP
  4. Ojasvi Bhargava

    Ojasvi Bhargava Peon

    Messages:
    345
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    @S1M, pep1439 is absolutely correct, the code he gave worked for me.
    Div is not necessarily needed.
     
    Ojasvi Bhargava, Oct 31, 2010 IP
  5. S1M

    S1M Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You'll want to use a div tag. From W3C: "The <center> tag is supported in all major browsers. However, it is deprecated and should be avoided!"
     
    S1M, Oct 31, 2010 IP
  6. barsha01

    barsha01 Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can use div for background image or background color.
     
    barsha01, Nov 1, 2010 IP