I am having issues adding spacing around some text in my document. The section contains a paragraph (header) with an image to the right of it and then some more text below, all with a background color applied. If I use regular paragraphs I can get things aligned how I need them but the paragraph text buts up against the edges of the background and I cannot seem to figure out how to add spacing so the text does not touch the edges (in CSS this would be padding). I have managed to get the correct spacing by using a textbox but then my absolutely positioned image disappears off the screen regardless of what I set for the Horizontal and Vertical position. See screenshots below for examples of using paragraphs vs textbox.
As textbox (correct spacing but image is gone):
As paragraph (correct image placement but no spacing):
My initial thought is that the spacing is not present when using the paragraph because the background color will only extend to the ends of the paragraph. I'm not really sure how to handle this so any help would be appreciated.
Hi Lokesh, after trying what you suggested I was still not
able to achieve the desired results. Adding spacing to the paragraph
pushes the entire thing over. I basically want a text box with a blue
background as shown in the screen shot with an image. I feel as though
in this case the text box is my best bet but I cannot figure out how to
get the image to appear correctly. When I use a textbox the image
disappears so rather than try to add spacing, i think what we need to
figure out is why the image is not shown, then I should be all set.
Below is a screenshot of what happens when I try adding space before the paragraph. As you can see the entire blue box gets pushed over since it just a paragraph with a background; I sort of expected this behavior. The second image is the desired result. Could you please tell me how to get the image to display in the textbox? I'm not sure why it gets positioned out of view no matter what I set the HorizontalPosition to.
Unfortunately I am not able to provide you with the document as it is for a Federal government client and is property of the Federal government, the best I can do is provide you with screenshots unfortunately :/
I can however provide you with a small code sample (attached) so that you can see what I have attempted thus far.
Added spacing BEFORE paragraph:
Desired result:
Need to figure out why the image does not display in the texbox as shown.
After messing with it some more I found out a way to get the desired results! Instead of appending the image to the textbox body I appended it to another paragraph and that did the trick :)