Skip to content
GravityKit
Buy
Sign in
0 items
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Formsโ€”everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    Ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Plugins

    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Formsโ€”everything you need to build powerful web apps and workflows.

    Learn more
  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies

    How to build...

    • Property Management
    • Product Catalog
    • Fundraising Dashboard
    • Real Estate Directory
    • Document Library
    • Academic Journal
    • Volunteer Management
    • Meal Tracker
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Pricing
  • About
0 items
Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityActions
    • GravityBoard
    • GravityCalendar
    • GravityCharts
    • GravityEdit
    • GravityExport
    • GravityImport
    • GravityMath
    • GravityMigrate
    • GravityRevisions
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GF Zero Spam
    • GravityExport Lite

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityMigrate
      • GravityRevisions
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GF Zero Spam
      • GravityExport Lite
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
    • Contact

    GravityCalendar

    • Add a GravityCalendar to Apple Calendar
    • Add a GravityCalendar to Google Calendar
    • Adding custom CSS to your Views
    • Attaching an event into a notification
    • Calendar Blocks
    • Calendar Setting: “No Current Events Behavior”
    • Calendar Shortcodes
    • Calendar: Developer Hooks
    • Can I book an appointment with GravityCalendar?
    • Creating recurring events in Gravity Forms
    • Displaying a calendar
    • Displaying events from another calendar with GravityCalendar
    • Event Field events are showing as all-day in GravityCalendar
    • Getting Started with GravityCalendar
    • GravityCalendar – Customizing event colors
    • How can I change the day weeks start on in Calendar?
    • How to download or subscribe to just one single event
    • How to enable repeating events
    • How to process shortcodes contained within fields used by the Calendar
    • How to remove the all-day text in the calendar list layout
    • I can’t see GravityCalendar settings or create a calendar
    • My calendar or events arenโ€™t displaying
    • Pre-selecting a calendar date using URL parameters
    • The difference between subscribing to a calendar and downloading calendar events
    • Working with timezones in GravityCalendar
    • Home
    • Docs
    • GravityCalendar
    • Adding custom CSS to your Views

    Adding custom CSS to your Views

    Estimated reading: 3 minutes

    Updated on April 24, 2026

    GravityView allows you to add custom CSS directly to a View through the Custom Code tab in the View Settings. The CSS loads only when that View renders, so it won’t affect other pages on your site.

    Note: This feature requires GravityView 2.19 or later. Placeholders require GravityView 2.50 or later.

    How to add custom CSS #

    1. Edit your View in WordPress.
    2. Scroll down to the Settings metabox.
    3. Click the Custom Code tab (the code icon).
    4. Enter your CSS in the Custom CSS field.
    5. Click Update or Publish.

    The CSS is placed inside <style> tags in the page’s <head>, after GravityView’s default styles. This means your custom CSS takes priority over GravityView’s built-in styles.

    Available placeholders #

    GravityView provides three placeholders that are automatically replaced with View-specific values when the page loads. Use these to write CSS that targets only this View.

    PlaceholderReplaced withExample output
    VIEW_SELECTORA CSS selector targeting only this View.gv-container.gv-container-123
    VIEW_IDThe View’s ID number123
    GF_FORM_IDThe connected Gravity Forms form ID5

    Using VIEW_SELECTOR (recommended)

    VIEW_SELECTOR is the easiest way to scope styles to a single View. It outputs a double-class selector (e.g., .gv-container.gv-container-123) that provides high specificity, so you typically don’t need !important.

    VIEW_SELECTOR {
        background: #f5f5f5;
    }
    
    VIEW_SELECTOR .gv-table-view th {
        background: #333;
        color: white;
    }

    Using VIEW_ID

    VIEW_ID is useful when you need the raw View ID number, for example in an HTML id attribute selector.

    #gv-view-VIEW_ID-1 {
        border: 2px solid #0073aa;
    }

    Targeting multiple instances of the same View

    When the same View is embedded multiple times on a page, each instance gets a unique HTML id with an incrementing number: gv-view-{VIEW_ID}-1, gv-view-{VIEW_ID}-2, etc.

    /* First instance */
    #gv-view-VIEW_ID-1 {
        max-width: 600px;
    }
    
    /* Second instance */
    #gv-view-VIEW_ID-2 {
        max-width: 100%;
    }

    Using GF_FORM_ID

    GF_FORM_ID is replaced with the connected Gravity Forms form ID. If the View does not have a connected form, this placeholder is left as-is to avoid generating invalid CSS.

    Important notes #

    • Placeholders are case-sensitive and must be uppercase.
    • Placeholders are replaced everywhere in your code, including inside comments.
    • Custom CSS is output only once per View, even if the same View is embedded multiple times on a page.
    • The double-class selector from VIEW_SELECTOR provides enough specificity that !important is typically unnecessary.

    Developer notes #

    Custom CSS is added using WordPress’s wp_add_inline_style() function, attached to the gravityview_default_style handle. This means it loads in the <head> after GravityView’s main stylesheet.

    You can add custom placeholders using the gk/gravityview/custom-code/placeholders filter:

    add_filter( 'gk/gravityview/custom-code/placeholders', function( $placeholders, $view, $content ) {
        $placeholders['SITE_NAME'] = get_bloginfo( 'name' );
        return $placeholders;
    }, 10, 3 );

    Note: If you have removed the default container classes using the gravityview/render/container/class filter, the VIEW_SELECTOR placeholder will not match your View’s container. Use the VIEW_ID placeholder instead.

    Related articles #

    • Adding custom JavaScript to your Views
    • View Settings: Custom Code
    • Adding custom PHP code snippets to your website
    Still stuck? How can we help?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous รฉcrire dans votre langue maternelle si cโ€™est plus facile pour vousโ€”nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta mรกs fรกcil; ยกnosotros nos encargamos de la traducciรณn!
    Sie kรถnnen uns in Ihrer Muttersprache schreiben, wenn das fรผr Sie einfacher ist โ€“ wir kรผmmern uns um die รœbersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is โ€” wij zorgen voor de vertaling!
    Du kan skrive til oss pรฅ ditt morsmรฅl hvis det er enklere for deg โ€” vi tar oss av oversettelsen!
    Du kan skriva till oss pรฅ ditt modersmรฅl om det รคr lรคttare fรถr dig โ€” vi tar hand om รถversรคttningen!
    Vocรช pode nos escrever em seu idioma nativo se for mais fรกcil para vocรช โ€” nรณs cuidaremos da traduรงรฃo!
    Puoi scriverci nella tua lingua madre se ti รจ piรน facile โ€” penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Stay informed?

      Was this page helpful?

      Table Of Contents
      • How to add custom CSS
      • Available placeholders
      • Important notes
      • Developer notes
      • Related articles
      GravityKit
      • How to Build It
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Privacy Policy
      • Terms of Service (โ€œTermsโ€)
      About Us
      • GravityKit on Mastodon
      • GravityKit on Twitter
      • GravityKit Training Courses
      • GravityKit on Facebook
      • Join our Facebook Group
      • Facebook
      • Twitter
      Get notified of updates.

      Weโ€™re constantly improving GravityKit. Fill out your email below and weโ€™ll notify you anytime major updates drop.

      GravityKit is a Gravity Forms Certified Developer.

      Copyright ยฉ 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.