I do not know a way in CSS, but using jQuery, you can do that.
This is the HTML file:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="s.css">
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="sh.js"> </script>
</head>
<body>
<p>LILI</p>
<br>
<p>Dina</p>
<p>ADEM</p>
</body>
</html>
Just use this jQuery:
$( document ).ready(function() {
$( "br" ).nextAll().css( "font-size", "35px" );
});
So it will apply to all paragraph elements after this empty line.
Using that, Dina
and ADEM
will have font-weight: 35px
, while LiLi
still normal. If you want to use more than one style you can do:
$("br").nextAll().css({"color":“beige","font-size":“35px",....});
If you want to only target one paragraph after <br
> use the jQuery closest()
method.
element. But I need to style every paragraph after the empty lines, and since I cannot edit the HTML code, I cannot add a class to these paragraphs. – VorganHaze Jan 19 '18 at 19:57