Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

html

css

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

What is the best way to do this?

like image 853
ian Avatar asked Nov 28 '22 11:11

ian


2 Answers

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

like image 122
Pablo Santa Cruz Avatar answered Dec 06 '22 04:12

Pablo Santa Cruz


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;" />

like image 41
Matt Baker Avatar answered Dec 06 '22 05:12

Matt Baker