As i am new learner, i'm trying this css styles by watching YT videos
If you see the code below, i am having "../images/..." as my 'src' attribute value in my html
so in css, i have written img[src="../images/"] {...}, which is same as in html but the styles didn't work here
But when i gave a caret like this img[src^="../images/"] as said in video then the written style has worked
why is it? Please explain
img[src="../images/"] {
border: 10px solid green;
}
<img src="../images/lesson img-2.jpg">
<h2 class="subtitle" id="subtitle-id" style="color: green;">Contact Us</h2>
<form>
<input type="text" placeholder="Full Name">
<input type="email" placeholder="Email">
<textarea></textarea>
<button>Submit</button>
</form>
img[src^="../images/"] {
border: 10px solid green;
<img src="../images/lesson img-2.jpg">
<h2 class="subtitle" id="subtitle-id" style="color: green;">Contact Us</h2>
<form>
<input type="text" placeholder="Full Name">
<input type="email" placeholder="Email">
<textarea></textarea>
<button>Submit</button>
</form>