ian
ian

Reputation: 12335

how do i put a space between my image and its border?

I want to put a space between my image and it's border.

What is the best way to do this?

Upvotes: 6

Views: 27470

Answers (3)

Kelvin
Kelvin

Reputation: 1143

Use padding

#image {border-right: 1px solid #000; padding-right: 10px;}

Upvotes: 1

Matt Baker
Matt Baker

Reputation: 3754

Padding allows you to control the space between your image and its border. Padding is just one piece of a larger concept, the CSS Box Model, which includes the content, padding, border and margin. I encourage you to check it out!

The CSS required in your case would be of the form:

<img src="foo.jpg" style="padding:10px;" />

Upvotes: 5

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181280

You can use Padding in your style attribute or CSS class.

Upvotes: 21

Related Questions