Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Image Padding

Posted on 2004-11-01
7
Medium Priority
?
16,150 Views
Last Modified: 2011-08-18
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
Comment
Question by:jezella
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12465098
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
 

Author Comment

by:jezella
ID: 12466264
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
 
LVL 31

Accepted Solution

by:
seanpowell earned 500 total points
ID: 12466458
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jezella
ID: 12467196
That's much better Sean, page lookes better and with more control. Thank you and also to Cd&

Jezella
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 12467284
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
 

Author Comment

by:jezella
ID: 12468108
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
 
LVL 31

Expert Comment

by:seanpowell
ID: 12468591
It should...
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question