Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the HTML to have a horizontal space between two objects?

Tags:

html

css

I have been searching for an answer and trying different things without success. Could someone kindly let me know how to put spaces between two objects by using PHP code? (Please note: I use WordPress, in case that makes a difference.)

I know how to do so vertically with </br>, but what is the horizontal equivalent to that?

Please note that I don't know a whole lot about code, so any detailed information you are able to provide is very much appreciated in advance - thank-you very much!

like image 285
user2376452 Avatar asked May 13 '13 05:05

user2376452


People also ask

How do you put a horizontal space between two elements in HTML?

To create extra spaces before, after, or in-between your text, use the &nbsp; (non-breaking space) extended HTML character.

How do you put space between things in HTML?

To insert blank spaces in text in HTML, type &nbsp; for each space to add. For example, to create five blank spaces between two words, type the &nbsp; entity five times between the words. You do not need to type any spaces between the entities.


2 Answers

I guess what you want is:

&nbsp; 

But this is usually not a nice way to align some content. You better put your different content in

<div> 

tags and then use css for proper alignment.


You can also check out this post with useful extra info:

  • How to insert spaces/tabs in text using HTML/CSS?
like image 178
Chief Wiggum Avatar answered Oct 20 '22 19:10

Chief Wiggum


You should put a padding in each object. For example, you want a space between images, you can use the following:

img{    padding: 5px; } 

That means 5px paddin for ALL sides. Read more at http://www.w3schools.com/css/css_padding.asp. By the way, studying a lot before attempting to program will make things easier for you (and for us).

like image 26
kireirina Avatar answered Oct 20 '22 19:10

kireirina