Logo
16 Aug 2017 | 1 min. (42 words)

Styling readonly attributes with CSS

There may be times in which you need to style inputs which have been set with a readonly state.

In which case you can simply include the readonly attribute in your CSS selector to target this particular state:

input[readonly]
{
    background-color:#ccc;
}
css readonly input
Twitter Facebook

8 Useful Atom Packages

8 Atom Packages which are useful for front-end development…

Moving from Wordpress to Hugo

Read why I've moved from Wordpress CMS to Hugo static site generator…

Related Links

  • LinkedIn
  • Twitter: @curtcode
  • Stack Overflow
  • GitHub: @curtiscde

Stack Exchange

profile for Curtis on Stack Exchange, a network of free, community-driven Q&A sites
Follow @curtiscde

Recent Posts

  • My terminal setup and commands I use on a daily basis when working with GitHub
  • Displaying latest posts on your GitHub profile
  • Using Codecov within a monorepo
  • Displaying Strava stats using webhooks & GitHub Actions
  • Filtering duplicate data points on Chart.js
Theme Bleak by zutrinken Published with Hugo
Menu