[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 16152
  • Last Modified:

Image Padding

How do I add padding to an image so that it is on 2 sides only so that text is kept away from the right and botton sides of the image.

So maybe something like this:-

.p2 { padding:0em 3em 3em 0em}

Jezella
0
jezella
Asked:
jezella
  • 3
  • 3
1 Solution
 
COBOLdinosaurCommented:
Just put the image in a span using that class:

<span class="p2"><img src="yourimage.jpg"></span>

The span will size to the image plus the padding.

Cd&
0
 
jezellaAuthor Commented:
This does not appear to work as I had hoped as I loose the test to the right.

This is an example http://www.ashley-wedding-cars.co.uk/examples/about-us.htm where I want to maintain the general layout but increase the space between the master image (the one with the question mark) and the text to the right of the image.

What CSS would I need to write to achieve this@

Many thanks

Jezella
0
 
seanpowellCommented:
Hi Jezella,

This is the basic format:

<p><img style="float:left; margin:0 3em 3em 0; border:none;" src="" width="500" height="256">Text</p>

(Don't use align="left" or hspace...)

Sean
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
jezellaAuthor Commented:
That's much better Sean, page lookes better and with more control. Thank you and also to Cd&

Jezella
0
 
seanpowellCommented:
My pleasure.
I posted a response to your other FP Q a while ago, don't know if I'm too late or not...
Sean
0
 
jezellaAuthor Commented:
Sean in an external CSS, should the following work

.top-left-image
      {
      float:left; margin:0 3em 3em 0; border:none;
      }


That table sizing was a problem Sean.

Jezella
0
 
seanpowellCommented:
It should...
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now