Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Heya folks,
Newbie question for you, I have a DIV 500px by 300px, and an image with identical dimensions placed there-in using "background-image".
When applying padding, it affects the Image as well, when I only really want it to affect the text? In this case, the Image supplies a border for the DIV, and the text must keep inside it.
Using <Span style="padding: 5px;"> or something on the text is out the question, since the DIV's contents changes via JavaScript, copying and pasting various hidden DIV's into this Main DIV via "element.InnerHTML".
I would prefer to avoid a smaller DIV positioned inside the existing DIV as well, i.e. Outter DIV has the background image, and the Inner DIV contains the Sentences.
Thus, can I achieve what seems so simple, with a Single DIV? A background image, with Text confined to a specific area within the DIV?
Thanks for your help in advance :)

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |