A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_URI::$config is deprecated

Filename: core/URI.php

Line Number: 102

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Router::$uri is deprecated

Filename: core/Router.php

Line Number: 128

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$benchmark is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$hooks is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$config is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$log is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$utf8 is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$uri is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$exceptions is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$router is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$output is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$security is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$input is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$lang is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$db is deprecated

Filename: core/Loader.php

Line Number: 397

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_DB_mysqli_driver::$failover is deprecated

Filename: database/DB_driver.php

Line Number: 372

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$email is deprecated

Filename: core/Loader.php

Line Number: 1284

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 303

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 328

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 355

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 365

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 366

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 367

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 368

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 426

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 110

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Session cannot be started after headers have already been sent

Filename: Session/Session.php

Line Number: 137

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$session is deprecated

Filename: core/Loader.php

Line Number: 1284

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$form_validation is deprecated

Filename: core/Loader.php

Line Number: 1284

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$pagination is deprecated

Filename: core/Loader.php

Line Number: 1284

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property Blog::$zip is deprecated

Filename: core/Loader.php

Line Number: 1284

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$load is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$benchmark is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$hooks is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$config is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$log is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$utf8 is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$uri is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$exceptions is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$router is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$output is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$security is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$input is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$lang is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$db is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$email is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$session is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$form_validation is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$pagination is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$zip is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /www/wwwroot/SINHCOMS/VT/main/application/controllers/Blog.php
Line: 20
Function: view

File: /www/wwwroot/SINHCOMS/VT/main/index.php
Line: 160
Function: require_once

Vismrit Tech | Home Startup
Pseudo-classes
Blog Author
Theresa Underwood
  • Sep 10, 2021
  • 9 min to read

A Pseudo class in CSS is used to define the special state of an element. It can be combined with a CSS selector to add an effect to existing elements based on their states. For Example, changing the style of an element when the user hovers over it, or when a link is visited. All of these can be done using Pseudo Classes in CSS.

HTML provides pseudo-classes, classes that are defined by default and allow us to apply a style on either:

  1. An element which is in a specific state.
  2. A specific set of elements by their hierarchy, explained in detail in the Advanced Selectors section.

We will discuss the former in this page, and give examples for each pseudo-class. Keep in mind that there is no way of inlining pseudo-classes in CSS.

Links

A link can either be in an unvisited state or a visited state. An unvisited link is a link that was not clicked on. A visited link is a link that was clicked on.

<style>
a.special:link {
    color: green;
}

a.special:visited {
    color: red;
}
</style>

<p><a href="#">This is a standard link, it will become purple when clicked</a></p>
<p><a class="special" href="#">This is a special colored link and become red when clicked</a></p>

Hover

The CSS :hover pseudo-class can be used to define styles for HTML elements which the user is hovering upon using the mouse.

<style>
p:hover {
    background-color: yellow;
}
</style>
<p>Paragraphs now have a yellow background when hovering over them.</p>

Active and Target

The CSS :active pseudo-class defines the styles to use for an element which is currently being clicked.

<style>
a:active {
    font-weight: bold;    
}
</style>
<p>
    <a href="#first">First Section</a>
    <a href="#second">Second Section</a>
    <a href="#third">Third Section</a>
</p>

Navigating to a specific section in the page also allows us to style the destination element.

<style>
p:target {
    font-weight: bold;    
}
</style>
<p>
    <a href="#first">First Section</a>
    <a href="#second">Second Section</a>
    <a href="#third">Third Section</a>
</p>
<p id="first">This is the text of the first section.</p>
<p id="second">This is the text of the second section.</p>
<p id="third">This is the text of the third section.</p>

Focus

The CSS :focus pseudo-class defines the styles to use for an element which is focused.

<style>
input:focus {
    font-weight: bold;    
}
</style>
<form>
    <p><input type="text" value="First field"></p>
    <p><input type="text" value="Second field"></p>
    <p><input type="text" value="Third field"></p>        
</form>

For more state-specific pseudo classes that relate to HTML form input elements, please visit Input Pseudo-classes.

For advanced selectors that enable greater control on selecting specific elements, please visit Advanced Selectors.

Do it yourself

This page does not have an exercise yet. You are welcome to contribute one by sending me a pull request:

https://github.com/ronreiter/interactive-tutorials

Comments:

Blog Comment
Sophie Asveld

February 14, 2021

Email is a crucial channel in any marketing mix, and never has this been truer than for today’s entrepreneur. Curious what to say.

Blog Comment
Ariana Gerad

February 14, 2021

Email is a crucial channel in any marketing mix, and never has this been truer than for today’s entrepreneur. Curious what to say.

Blog Comment
Sophie Asveld

February 14, 2021

Email is a crucial channel in any marketing mix, and never has this been truer than for today’s entrepreneur. Curious what to say.

Leave a comment:

Contact Information

Sinhcoms
Nalanda Bihar, India

We're Available 24/7. Whatsapp Now. (+91) 9123288803 (121)255-53333
Find us here