CSS stands for Cascading Style Sheets and it is the mixture of an element and a selector which helps in identifying particular elements on a web page like xpath, CSS selector which can be used to locate web elements that does not contain ID, class or name.
Different kind of selectors are available in css and some are mentioned below:
1. Class selector: It’s declared with a dot preceding a string of one or more characters.
HTML code
{code}
<div class="testing"></div>
{code}
css class syntax: .testing
{code}
<div class="testing"></div>
{code}
css class syntax: .testing
2. id selector: It is declared using a hash or pound symbol (#) preceding a string of characters.
HTML code
{code}
<div id="testing"></div>
{code}
CSS ID syntax: #testing
3. Attribute: It can be a value, type or name etc.
{code}
<input
type="
submit"></
input>
{code}
CSS Attributesyntax: input[type=’submit’]
Post a Comment