Text in Border CSS HTML

后端 未结 8 2111
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 05:56

I\'d like to have a div that looks like this:

\"border

Is this possible to do with HTML + CSS

8条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 06:31

    For a duplicate, here another option with transform, no fieldset ( and rounded border required in the duplicates) :

    position or transform can help you too :

    * {
      margin: 0;
      padding:0;
      box-sizing:border-box;
    }
    
    .fieldset {
      border: solid;
      color: #353fff;
      border-radius: 1em;
      margin: 2em 1em 1em;
      padding:0 1em 1em;
    }
    
    .legend {
      transform: translatey(-50%);
      width: max-content;
      background: white;
      padding: 0 0.15em;
    }
    
    .fieldset li {
      list-style-type: " - ";
    }

    Some Title

    • Item
    • Item
    • Item
    • Item

提交回复
热议问题