Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How do I add background image to block of <p>

    Id use a div right?

    so -

    .background-image{
    background-image:url(xxx.png)
    }

    then

    <div class="background-image">

    <p>TEXT</p>

    </div>

    Thanks

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,745
    Thanks
    0
    Thanked 244 Times in 239 Posts
    Hi there listerdl,

    if you want to add a "background-image" to the "p element", then add it to the "p element".

    If you want to add a "background-image" to the "div element", then add it to the "div element".

    If you want the whole "background-image" to be visible in the element of your choice, then that
    element would require either a "min-height" value or sufficient content.

    coothead


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •