Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-09-2012, 06:25 PM   PM User | #1
listerdl
Regular Coder

 
Join Date: Mar 2011
Posts: 157
Thanks: 7
Thanked 0 Times in 0 Posts
listerdl is an unknown quantity at this point
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
listerdl is offline   Reply With Quote
Old 11-09-2012, 07:46 PM   PM User | #2
coothead
Senior Coder

 
coothead's Avatar
 
Join Date: Jan 2004
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 1,555
Thanks: 0
Thanked 196 Times in 192 Posts
coothead will become famous soon enough
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
coothead is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:52 AM.


Advertisement
Log in to turn off these ads.