How to disable
tags inside
by css?

前端 未结 4 870
日久生厌
日久生厌 2020-12-15 15:28


won\'t let me to display 3 buttons inline, so i need to disable it inside div, and I can\'t just delete them, they are automatically there.

I

相关标签:
4条回答
  • 2020-12-15 16:01

    You could alter your CSS to render them less obtrusively, e.g.

    div p,
    div br {
        display: inline;
    }
    

    http://jsfiddle.net/zG9Ax/

    or - as my commenter points out:

    div br {
        display: none;
    }
    

    but then to achieve the example of what you want, you'll need to trim the p down, so:

    div br {
        display: none;
    }
    div p {
        padding: 0;
        margin: 0;
    }
    

    http://jsfiddle.net/zG9Ax/1

    0 讨论(0)
  • 2020-12-15 16:09
    <p style="color:black">Shop our collection of beautiful women's <br> <span> wedding ring in classic &amp; modern design.</span></p>
    

    Remove <br> effect using CSS.

    <style> p br{ display:none; } </style>
    
    0 讨论(0)
  • 2020-12-15 16:15

    or hide any br that follows the p tag, which are obviously not wanted

    p + br {
        display: none;
    }
    
    0 讨论(0)
  • 2020-12-15 16:24

    I used it like this:

    @media (max-width: 450px) {
      br {
        display: none;
      }
    }
    

    nb: media query via Foundation nb2: this is useful if one of the editor intend to use
    tags in his/her copy and you need to deal with it specifically under some conditions—on mobile for example.

    0 讨论(0)
提交回复
热议问题