w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
  • References
  • CSS
  • CSS Selectors

User Action Pseudo-Class - :focus

Pattern:

:focus

 

Definition:

The :focus pseudo-class matches the element that has the focus (E.g., when an input field has the text-input cursor within it).

 

Examples:

Style an input field when it has the focus

input:focus { border: 2px dashed thistle; }
w10schools
w10schools
2014-11-13 18:25:05
Form Input
Comments
Leave a Comment

Please login to continue.

Popular Articles
User Action Pseudo-Class - :hover Pattern: :hover   Definition: The :hover pseudo-class matches elements that are in a hovered (mouseover) state.   Examples: Style any <p>
User Action Pseudo-Class - :active Pattern: :active   Definition: The :active pseudo-class matches any element that is being activated (E.g., when clicking on it) by the user.   E
Pseudo-Class - :empty Pattern: :empty   Definition: The :empty pseudo-class matches elements that have no children at all (including content nodes, such as text).   E
Pseudo-Class - :root Pattern: :root   Definition: The :root pseudo-class matches an element which is the root of the document. It always represents the <html> el
Language Pseudo-Class - :lang Pattern: :lang   Definition: The :lang pseudo-class matches the elements based on their human-language information.   Examples: Style every <


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com