• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS How to automatically add space in CSS after buttons?

Kaworu

New Coder
Hi.

I am making a very simple website. It consists mostly of buttons which are links to other pages on the net. The buttons are top-down oriented. I want to code is CSS in a way that will automatically add space after each button. Sadly, I have completely no idea how to do it other than putting <br> after every button, which I wanna avoid.

Source code:

HTML:
<!DOCTYPE html>

<html>

    <head>
        
        <link rel="stylesheet" href="style.css">
        
    </head>

    <body>
            
        <a href="http://www.wp.pl"><button type="button" class="mybutton">Wp.pl</button></a>
        <a href="http://www.onet.pl"><button type="button" class="mybutton">Onet.pl</button></a>

    </body>

</html>

CSS:
.mybutton
{
    width: 66%;
    height: 50px;

    border: 2px solid black;
    
    position: relative;
}

.mybutton::after
{
    /* HERE SHOULD BE SOME CODE, BUT I DON"T KNOW WHICH :( */
}
 

Top