我的左边框宽度更大,而且有黑色而不是我文字的背景颜色(下面的截图和代码)。
我已经尝试过:
background-size: 80px 60px;
我希望它保留为文本背景颜色(导航栏的其余部分)。
HTML:
<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>
CSS:
#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;
}
#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;
border-left-width: 15px;
}
答案 0 :(得分:0)
改变这个:
#homelink {
border-left-width: 15px;
}
对此:
#homelink {
padding-left: 15px;
}
JSfiddle:https://jsfiddle.net/j5157mc0/