[html] How to disable <br> tags inside <div> by css?

<br> 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 have:

<div style="display:block">
<p>Some text</p>
<br>
<p>Some text</p>
<br>
</div>

and I want:

<div style="display:block">
Some text Some text
</div>

More info

I do not want to have mystyle.css file. Of course I know that way of disabling it.

I asked how to add to divs style this br { display: none; } if it is possible.

Solution:

  1. It is not possible to remove just <p> tags without removing content inside.
  2. It is not possible to hide <br> directly by divs style, so I make it this way:
<style type="text/css">
.mydiv {
display: block;
width: 100%;
height: 10px;
}
.mydiv br {
display: none;
}
</style>

<div class="mydiv">
Some text
Some text
</div>

http://jsfiddle.net/cGT4E/

This question is related to html css

The answer is


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

p + br {
    display: none;
}

<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>

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.