Sir I have following codes

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">
#aboutus {
  border: 1px solid silver;
  color: white;
  font-size: 12pt;
  width: 250px;
  margin: 0 auto;
  background: #F0FFF0;
  background: url(images/dream2.jpg);
  background-size: cover;
  text-align: center;
  padding: 20px;
  overflow: auto;

#units {
  border: 1px solid silver;
  color: red;
  width: 220px;
  height: 80px;
  background: white;
  text-align: left;
  padding: 5px;
  float: left;
  margin: 2px;

#units p {
  font-size: 14px;
  color: green;

#units span {
  color: blue;
  font-size: 14px;
  font-style: italic;
    <div id="aboutus">

        <div id="units">
        My Compnay Name
        <p>My company Address</p>
        <span>My Company Contact Numbers</span>

I want to remove gap between second and third line shown in image.

Edited by tqmd1: correction

Attachments c.png 7.3 KB
3 Years
Discussion Span
Last Post by DaveAmour

You're juggeling a bit with html tags in 'units', but the spacing is caused by the browser default styling (margin-bottom) of the paragraph tag. To get rid of it, set it to '0'.

Edited by gentlemedia


There are many ways you can do this. Perhaps the simplest is just to restructure your html slightly with:

        <div id="units">
            My Company Name
                My company Address<br />
                <span>My Company Contact Numbers</span>

With CSS there are probably a dozen ways of doing it but the above seems least effort. PS You spelled Company wrong too!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.