CSS Selectors Every Web Designer Should Know

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: views/courses-details.php

Line Number: 76

Backtrace:

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/views/courses-details.php
Line: 76
Function: _error_handler

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/controllers/Welcome.php
Line: 653
Function: view

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: views/courses-details.php

Line Number: 76

Backtrace:

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/views/courses-details.php
Line: 76
Function: _error_handler

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/controllers/Welcome.php
Line: 653
Function: view

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/index.php
Line: 315
Function: require_once

Training Mode Regular Fastrack Crash
Classroom | Online

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: views/courses-details.php

Line Number: 116

Backtrace:

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/views/courses-details.php
Line: 116
Function: _error_handler

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/controllers/Welcome.php
Line: 653
Function: view

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: views/courses-details.php

Line Number: 116

Backtrace:

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/views/courses-details.php
Line: 116
Function: _error_handler

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/controllers/Welcome.php
Line: 653
Function: view

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/index.php
Line: 315
Function: require_once

Course Description :

css selectors in an important part or topic of css , it defines how to select html elment by different different css selectors such as element selector, class selector, group selector  etc. css selectors is mandatory to learn for beginners in right way because , if beginners know when to use which selector then he can reduce unwanted line of code in css. There are number of css selectors, some of following : 

1. Element Selector : As its name tells about itself , Select any html element by its name.

Syntax :  

element-name
{
    property : value
}

Example : 

HTML : 

<p>web designing</p>

<p>web development</p>

<p>graphic design</p>

CSS :

p

{

   color:red;

}


Element selector is used to select all specific html element ,e.g select all paragraph, select all headings etc. It is mostly used in website such as to mention equal font size or font family of paragraph for website etc.

 

2. Class Selector : Class selector is used when we want to select specific html element, which contains class attribute. It is reuseable selector.

 

Syntax :

 

.classname

{

Property : value

}

 

Example :

HTML

<div class=”box”></div>

<div class=”box”></div>

CSS :

.box

{

  width: 300px;

height:300px;

background:#f00;

}

3. Group Selector :  Group Selector is used to select group of elements or we can say that we can select more than one element at time, it helps when we have to use same properties in two or more different elements such as we have to remove symbol from ul and ol. Group Selector is denoted by (,) symbol.

Syntax

Firstelement, Secondelement…

Example :  Remove symbol and number from list

HTML

<ul>

<li>Web Design</li>

<li>Web Development</li>

</ul>

<ol>

<li>Web Design</li>

<li>Web Development</li>

</ol>

 

CSS

ul,ol

{

list-style:none;

}

4. Descendant Selector : Descendant Selector is used to select element on behalf of its parent or we can simply say that we can select element by its parent name. It is useful when we have to select  any child of specific parent element  such as all list of ul or all paragraph of particular div etc.

Syntax :

parent-element child-element

{

}

Example : select all li of  particular div

HTML

<div class=”list1”>

<ul>

<li>list1</li>

<li>list2</li>

<li>list3</li>

<li>list4</li>

</ul>

</div>

 

<div>

<ul>

<li>list1</li>

<li>list2</li>

<li>list3</li>

<li>list4</li>

</ul>

</div>

 

CSS

.list1 li

{

  color:#000;

}

 

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: views/courses-details.php

Line Number: 422

Backtrace:

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/views/courses-details.php
Line: 422
Function: _error_handler

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/controllers/Welcome.php
Line: 653
Function: view

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: views/courses-details.php

Line Number: 422

Backtrace:

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/views/courses-details.php
Line: 422
Function: _error_handler

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/application/controllers/Welcome.php
Line: 653
Function: view

File: /home/hrdv7o2ounf4/public_html/institute-websites/webdevelopmentinstitute.com/index.php
Line: 315
Function: require_once

Request a Demo

Whatsapp