• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Frage Button CSS Code wird nicht angenommen.

Manolol

Neues Mitglied

Hallo! Ich habe eine kleine Webseite geschrieben, aber der CSS Code von den Buttons wird nicht übernommen. Weiß jemand warum?​


HTML:
HTML:
<head>
    <meta charset="utf-8"/>
    <title>Manolol</title>

    <link href="https://manolol.000webhostapp.com/styles/style.css" rel="stylesheet"/>
</head>
<body>
    <center>
        <h1 style="margin-top: 35px;">Welcome to the Manolol Homepage!</h1>
        <br>
        <h2>Click on the Links below to visit my projects!</h2>

        <h2>
            <a href="https://manolol.000webhostapp.com/manolopedia/index.html"><button class="button">Manolopedia (German)*</button></a>
            <a href="https://manolol.000webhostapp.com/tcones/index.html"><button class="button">#trafficconesmatter</button></a>
        </h2>
        <p style="margin-top: 25px;">*This site is an exercise project for me. Don't expect too much.</p>
    </center>
</body>

CSS:
CSS:
html {
    font-family: Arial;
}

body {
    background-color: rgb(226, 255, 172);
    margin-left: 15px;
}

button {
    font-size: 20px;
    font-weight: bold;
    padding: 2em 3em;
    cursor: pointer;
}
 
Werbung:
Da du offensichtlich noch in der Lernphase bist gehe ich auf dein HTML nicht weiter ein.
Aber sagen sollte man es vielleicht doch.
<center> = Ist veraltet und sollte vermieden werden.
Das kann man mit Flexbox oder Grid machen.
Ein Button im <a> Element hat sempervivum schon was zu gesagt.
<h1 style="margin-top: 35px;">= Inline Styls solltest du auch vermeiden.Dafür gibt es die Css Datei.
Einfach dazuschreiben
Code:
h1{
margin-top:35px;
}
Und den doctype nicht vergessen.
Code:
<!doctype html>
<html lang="de">
<head>
</head>
<body>
</body>
</html>
 
Werbung:
Und wenn wir einmal dabei sind: Das <br> zwischen h1 und h2 hat auch keinen wirklichen Sinn. Du kannst der h2 ebenfalls ein margin-top verpassen, wenn Dir der Abstand sonst zu klein ist.
 
Zurück
Oben