How to Add HTML Space Between Buttons?

Spread the love

Here simple post help you out to know or to add HTML space between buttons by using CSS, or function command.

There are four ways to add HTML space between two buttons are following:

Most common code that may help in many cases that would like:

How to Add HTML Space Between Buttons?


<div>Button 1</div> <p>Button 2 </div>

In the above example, you can replace the tag of span, button, div, and etc.

Margin attribute

Set the margin for all four sides of a <p> element to 35 pixels:

p {
margin: 35px;

Style direct in HTML tag

The <style> Element is use to apply a simple stylesheet an HTML document:

Inline styles is not commonly use some people use and apply the unique style rules, by putting the CSS rules directly into the start tag. It can be attached to an element using the style attribute.

Following example demonstrates how to set the margin of all text:

<h4 style="margin: 10px; margin-left: 20px;">This is called Heading<;/h4>
<p style="margin-top: 10px; margin-bottom: 30px;">This is Paragraph</p>


Using Div

The Margin properties of CSS are commonly used for creating spaces between two elements.

<style type="text/css">


margin-top: 10px;

margin-right: 10px;

margin-bottom: 10px;

margin-left: 10px;



4 Ways to Bring Your Text At the Center Using HTML

Leave a Comment