Consider the following
<body>
<div class="startline"></div>
Welcome to my application <b>product</b>
<div class="endline"></div>
</body>
What the jQuery code does, looking for elements between startline and endline element and applyies a color for the elements found.
welcome to my application
on the other hand is not an element. Changing the color for this text, you must either wrap it into an element (span, p, div, etc...) or apply the color to its container element which is the body in this case.
Option 1: Style the current structure
CSS (BEST)
<style type="text/css">
body {
color: red;
}
.startline,
.endline {
color: initial;
}
</style>
JavaScript
$(document).ready(function () {
$('body').css('color', 'red'); // set text color the entire body
$('.startline, .endline').css('color', 'initial'); // reset the text color from startline, endline elements
});
Option 2: Wrap everything between startline and endline into another element (BEST)
<body>
<div class="startline">startline</div>
<div>Welcome to my application <b>product</b></div>
<div class="endline">endline</div>
</body>
CSS (BEST)
<style type="text/css">
body *:not(.startline):not(.endline) {
color: red;
}
</style>
JavaScript - use the jQuery you've tried:
$(document).ready(function(){
$(".startline").nextUntil(".endline").css({"color": "red", "border": "2px solid red"});
});
See How CSS works for more information.