Problem aligning divs next to each other?

后端 未结 3 1173
心在旅途
心在旅途 2021-01-22 01:40

I want this design:

DIV1: auto-size DIV2: 160px
divnumberonediv divtwo
divnumberonediv divtwo
divnumberonediv divtwo
divnumberonediv divtwo
divnumberonediv divt         


        
3条回答
  •  暖寄归人
    2021-01-22 02:36

    Not really sure what you're after, but you can try what I've done here. You should only use an id on a unique element in a document, so if you want more than one, re-assign them as classes. display: table-cell; is not needed here.

    HTML:

    ads would, hypothetically, be placed here if this were actually an actual website.

    This is the most amazing site in the world. It has a very nice design, and is perfect for everything. If there's something that this site can't do, then nothing can do it, but I'd suggest to try all of this site's features before complaining.

    CSS:

    .mainbulk {
        padding: 1.5em 2% 1.5em .5em;
        border: 1px solid #000;
    }
    .ads {
        width: 7.5em;
        float:right;
        text-align: right;
        border: 1px dotted #f00;
    }
    .textcontent {
        max-width: 40em;
        float: right;
        border: 1px dotted #00f;
    }
    

提交回复
热议问题