**Inside CSS file:**
input[type="text"]{ border: 2px solid red; } input::placeholder{ color:green; } input[title="google"]{ background-color:black; color:white; }
Why are the writing procedures for Type, Placeholder and Title different? Even though the text inside the tag looks the same. How to understand which are attributes and which are elements?
input::placeholder
selects the placeholder for, while
input[attribute="value"]
selects>
Its attribute value is value. They do different things.Visualization example:
NOTE: This answer was converted from a comment because I couldn't find any duplicate targets.