Home >Web Front-end >HTML Tutorial >Apply CSS styles to the ID element in HTML when its beginning remains the same but its ending is different
Posts can be selected using a div with "id=post". This will select all div elements with an id that contains the value in quotes.
We can use -
div[id*='post-'] { ... } or div[id^='post-'] { ... }.
div[id*='post-'] { ... } will select all div elements whose ids are quotes.
Alternatively we can use,
div[id^='post-'] { ... }
This will select all div elements whose id starts with quotes.
The above is the detailed content of Apply CSS styles to the ID element in HTML when its beginning remains the same but its ending is different. For more information, please follow other related articles on the PHP Chinese website!