I am using HTML. How can i give a red line before the text box as in screen shot?
Thanks!
I am using HTML. How can i give a red line before the text box as in screen shot?
Thanks!
There is plenty ways, one of them is to place the input inside of a div and then style it with CSS.
Here is an example:
<div style="border-left: 2px solid red; padding-left: 2px;">
<input type="text" />
</div>
And here you can see how it looks like:
you can do something like this :
here is a fiddle link
<div id="blc"><span> </span><input type="text"/></div>
#blc span {
border-left: 2px solid red;
}
demo: http://jsfiddle.net/n7c8H/1/
html:
<div class="red-border-left">
<input type="text" />
</div>
css:
.red-border-left {
border-left: 2px solid #FF0000;
}
You could use CSS pseudo selector :before but since it doesn't work for Input elements, you need to look for other options,
E-g Insert a span before the input element and use pseudo selector on that. e-g:
<!DOCTYPE html>
<html>
<head>
<style>
span:after{
content:"";
border:1px solid red;
margin-right:5px;
}
</style>
</head>
<body>
<span></span><input type="text" id="ttt" />
</body>
</html>
Its like this one:
<div class="redline"><input type="text" /></div>
For the css:
.redline {
border-left: #hexcode;
}