I'm new to HTML and CSS. I'm trying to create 3 centered links to other pages but I can't figure out why they not centered. CSS code is inlined in HTML.
a:link,
a:visited {
background-color: #f44336;
color: white;
padding: 20px 30px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 30px;
font-weight: bold;
float: center;
}
a:hover,
a:active {
background-color: red;
}
h1 {
height: auto;
text-align: center;
float: center;
font-size: 20px;
font-weight: bold;
color: black;
padding-top: 5px;
padding-bottom: 5px;
}
<h1>Pagrindinis puslapis</h1>
<a href="php.html">PHP puslapis</a>
<a href="ruby.html">Ruby puslapis</a>
<a href="python.html">Python puslapis</a>
I tried to add float: center in a:link but it nothing changed.
give him width:100%;
– Paulo Mora Jan 17 '17 at 17:35