0

I made a website with HTML/CSS and I was working with my page navigator when I saw that there was a white space between my background and border of two words. A, d I don't now how to remove that white space here is a picture

enter image description here

The link buttonsar left above is there someone that now how to remove that?

My code.

<html>
<head>
<style>
#h1index {color : black;  text-align: center; background: linear-gradient(to bottom,#F2F2F2,#94A394); border-style: solid; border-radius: 25px; border-color: black;}
body {background-color: #F8F8F8;} <!-- achtergrond kleur -->
#tekstindex {color : black;}
#homelink {background: linear-gradient(to bottom,#F2F2F2,#94A394); border-style: solid;  border-color: black transparent black black;   text-decoration: none; border-radius: 25px 0px 0px 25px;  font-size: 25px; padding-left: 5px;  }
#projectslink {background: linear-gradient(to bottom,#F2F2F2,#94A394); border-style: solid;  border-color: black transparent black transparent;   text-decoration: none;  font-size: 25px; }
</style>
</head>
<body>
<a href="url" id="homelink">home</a> <!-- hompage link --> <a href="url" id="projectslink">projects</a> <!-- link naar projects pagina --><a href="url" id ="gameslink">games</a><!-- linkinaar games pagina -->
<h1 id="h1index"> welcom to the codenoob website </h1> <!-- welcom message -->
<p id="tekstindex">latest news.</p>
</body>
</html>
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252

3 Answers3

1

Inline elements are sensitive to white space in your code. Just remove it.

#h1index {
  color: black;
  text-align: center;
  background: linear-gradient(to bottom, #F2F2F2, #94A394);
  border-style: solid;
  border-radius: 25px;
  border-color: black;
}
body {
  background-color: #F8F8F8;
}
<!-- achtergrond kleur --> #tekstindex {
  color: black;
}
#homelink {
  background: linear-gradient(to bottom, #F2F2F2, #94A394);
  border-style: solid;
  border-color: black transparent black black;
  text-decoration: none;
  border-radius: 25px 0px 0px 25px;
  font-size: 25px;
  padding-left: 5px;
}
#projectslink {
  background: linear-gradient(to bottom, #F2F2F2, #94A394);
  border-style: solid;
  border-color: black transparent black transparent;
  text-decoration: none;
  font-size: 25px;
}
<a href="url" id="homelink">home</a><!-- hompage link --><a href="url" id="projectslink">projects</a> 
<!-- link naar projects pagina --><a href="url" id="gameslink">games</a>
<!-- linkinaar games pagina -->
<h1 id="h1index"> welcom to the codenoob website </h1> 
<!-- welcom message -->
<p id="tekstindex">latest news.</p>
j08691
  • 204,283
  • 31
  • 260
  • 272
0

Obviously, it is due to the space between two words.

You should use <span> to wrap the two words and apply the style on <span>

Jimmy Ko
  • 857
  • 1
  • 8
  • 20
0

try floating the buttons to the left. float:left. Also, setting the position to relative might work.

RomanK
  • 155
  • 1
  • 2
  • 13