Display block without 100% width

后端 未结 8 1055
谎友^
谎友^ 2020-12-12 21:27

I want to set a span element to appear below another element using the display property. I tried applying inline-block but without success, and figured I could use block if

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 22:11

    If I'm understanding your question properly, the following CSS will float your a below the spans and keep it from having a 100% width:

    a {
        display: block; 
        float: left; 
        clear: left; 
    }
    

提交回复
热议问题