How to Remove The Space Between Inline Block Elements

admin_img Posted By Bajarangi soft , Posted On 09-10-2020

To remove the space between the inline-block element use margin-right property. This property is used to remove the space between their right positioned element. This property generated negative values to remain close to their adjacent element.

Space Between Inline Block

To remove the space between the inline-block element use margin-right property. This property is used to remove the space between their right positioned element. This property generated negative values to remain close to their adjacent element.
Syntax:

element { 
    margin-right:value;
 }
Example
<!DOCTYPE html>
<html>
<head>
    <style>
        nav a {
            display: inline-block;
            margin-right:-4px;
            background: #f12e14;
            color:white;
            font-weight:bold;
            text-decoration:none;
        }
        h1 {
            color: #803300;
        }
        body {
            text-align:center;
        }
    </style>
</head>
<body>
<h1>Bajarangi Soft</h1>
<h2>margin-right:-4px;</h2>
<nav>
    <a href="#"> Bajarangi  </a>
    <a href="#"> for </a>
    <a href="#"> Web designers</a>
</nav>
</body>
</html>

Related Post