css class starts with & CSS class selector

css class starts with use a wildcard to select all div with a class that starts with str. Match an element that has the specified class.

css class starts with

A class selector in CSS starts with a dot (.). A CSS class is an attribute used to define a group of HTML elements in order to apply unique styling and formatting to those elements with CSS.

Match all elements having class name starting with a specific string

CSS [attribute^=value] Selector

div[class^="product"] {
  background: #3d3d3d;
}

Example

div[class^='loverank'], div[class*=' loverank']{
    color: #F00;
}

Wildcard Selectors (*, ^ and $) in CSS for classes

<!DOCTYPE html>
<html>
	<head>
		<style>
		
			/* Define styles of selected items, h1 and
			rest of the body */
			[class*="str"] { /* WE USE * HERE */
				background: red;
				color: white;
			}
			h1 {
				color:red;
			}
			body {
				text-align:center;
				width:80%;
			}
		</style>
	</head>
	<body>
		<h2>www.pakainfo.com</h2>
		<div class="first_str">The Main Website free download.</div>
		<div class="second">The Global Website free download.</div>
		<div class="my-strt">The Primary Website free download.</div>
		<p class="mystr">WorlCup Greatting</p>
	</body>
</html>

CSS: Class name selector- name starts with

a[class^='color-'], a[class*=' color-'] { ... }

Don’t Miss : How To Get CSS Class Name Property Using Jquery?

I hope you get an idea about css class starts with.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.