Aligning buttons in CSS/HTML in one line horizontally w/ text?

后端 未结 2 1238
情话喂你
情话喂你 2021-01-19 06:01

I would like to know how could I align my buttons horizontally? On top of that I want to add text to those buttons. This is what I currently have.

HTML body part:

2条回答
  •  执笔经年
    2021-01-19 06:44

    tables should not be used for layout. I think the best approach would be to use floated links like this:

    
    

    CSS:

    .tile_div a {
        display: block;
        float: left;
        height: 50px;
        width: 100px;
        margin-right: 5px;
        background-image: url(./images/button_left.png);
        text-align: center;
        line-height: 50px;
        text-decoration: none;
    }
    
    .title_div a.last {
        margin-right: 0;
    }
    
    .clear {
        clear: both;
    }
    

    JSFiddle

提交回复
热议问题