Experience League
      • Analytics
      • Campaign
      • Commerce
      • Customer Journey Analytics
      • Data Collection
      • Experience Manager
      • Experience Platform
      • GenStudio for Performance Marketing
      • Journey Optimizer
      • Journey Optimizer B2B Edition
      • Marketo Engage
      • Real-Time CDP
      • Target
      • Workfront
      • CoursesSkill-building courses with sharable completion certificates
      • PlaylistsExpertly curated collections of videos
      • TutorialsSolution-specific videos and how-tos
      • PerspectivesActionable insights from Experience Cloud customers and Adobe experts
      • CertificationProven expertise of Adobe marketing solutions
      • Instructor-led trainingLive & on-demand courses led by Adobe-certified instructors
    • Browse all content
  • Documentation
  • AI training
  • Events
      • Community home
      • Community Pulse BlogAnnouncements, trends, and stories from the community
      • Community resourcesGuides and tips to get started
      • AMAsLive "Ask me anything" sessions with experts
      • Discussion groupsNetwork online and in person by role, topic, or interest
      • Adobe User GroupsJoin global peer-led meetups
      • Skill ExchangeEvents to share best practices and connect with peers
      • Advocate programsOpportunities to lead, advise, and inspire
      • Experience Maker AwardsDiscover and celebrate innovators transforming digital experiences
      • Adobe Feedback ProgramInfluence Adobe product development
      • Analytics
      • Campaign
      • Experience Manager
      • Experience Platform
      • Journey Optimizer
      • Marketo Engage
      • Target
      • Real-Time CDP
      • Workfront
      • Creative Cloud
      • Document Cloud
  • Support
  • Search
    • Deutsch
    • English
    • Español
    • Français
    • Italiano
    • Nederlands
    • Português
    • Svenska
    • 中文 (简体)
    • 中文 (繁體)
    • 日本語
    • 한국어
  • All
  • Certification
  • Community
  • Courses
  • Documentation
  • Events
  • Perspectives
  • Playlists
  • Troubleshooting
  • Tutorials
DeutschEnglishEspañolFrançaisItalianoNederlandsPortuguêsSvenska中文 (简体)中文 (繁體)日本語한국어
Sign in
My learning profileBookmarked contentSign out
Adobe Experience CloudAdobe Document Cloud
DocumentationTargetTarget Guide

Element selectors used in the Visual Experience Composer

Last update: August 27, 2025
  • Topics:
  • Visual Experience Composer (VEC)

An element selector is a CSS expression that can identify one or more elements.

You can find basic information about CSS selectors in the Selectors document on the Mozilla Developer Network (MDN).

You can set whether to use element classed or element IDs in your account preferences. Click Administration > Visual Experience Composer, then choose your preferred CSS selectors.

  • Use element IDs: Disable if the same ID is used for multiple elements or element IDs might change on page load.
  • Use element classes: Disable if element classes on a page might change.
  • Use preferred selectors: Enable if you want to use unique selectors in the VEC to identify key areas of your website.
NOTE
Element Classes are available as selectors in A/B Test, Automated Personalization, and Multivariate Test activities.

For information about when to use CSS selectors and when to use unique IDs, see Visual Experience Composer Best Practices and Limitations.

How Target generates a selector for an element

Target uses a simple algorithm to create a selector. Here is a very brief explanation of the generation logic:

  1. If an element has an ID, for example id="container", then the selector for the element is #container.

    For Example:

    <div class="wrapper">
      <div id="container"> <!-- Selector is computed for this element -->
        <ul class="navigation">
          <li class="item active"> Home </li>
          <li class="item"> Men </li>
          <li class="item"> Women </li>
          <li class="item"> Kids </li>
        </ul>
      </div>
    </div>
    
  2. If an element contains a class attribute, Target attempts to leverage the first class of any classes present on the element.

    Target attempts to parse the parent element until it finds the <HTML> element or an element with an ID. Whenever an element contains an ID and the selector is computed on its descendant child, this element’s ID contributes to the selector.

    For example:

    <div class="wrapper">
      <div id="container"> <!-- id is present here. It contributes to selector -->
        <ul class="navigation">
          <li class="item active"> Home </li> <!-- Selector is computed for this element -->
          <li class="item"> Men </li>
          <li class="item"> Women </li>
          <li class="item"> Kids </li>
        </ul>
      </div>
    </div>
    

    In this example:

    Selector: #container > ul.navigation:eq(0) > li.item:eq(0) (" > " indicates the immediate child.)

    eq tells the index there’s an element that has “tagName=UL” and the first class is navigation. Therefore, index is 0. See the Selectors article in MDN for more information.

  3. If an element does not contain a class, Target uses tagName for the element and traverses up the parent element until either the <HTML> element or an element with an ID is found.

    For example:

    <div class="wrapper">
      <div id="container"> <!-- id is present here. It contributes to selector -->
        <ul class="navigation">
          <li> Home </li>
          <li> Men </li>
          <li class="active"> Women </li>
          <li> Kids </li><!-- Selector is computed for this element -->
        </ul>
      </div>
    </div>
    

    Selector: #container > ul.navigation(0) > li:nth-of-type(4)

In the above process:

  • You can use any CSS selector as long as it uniquely identifies an element in the DOM.
  • The approach above is the one used by Target. Target does not mandate that you use this approach. You can add any selector as long as point #1 is true.
  • You can use any attribute in the selector. This document only uses a class name as an example.

Target

  • Adobe Target Business Practitioner Guide Home
  • Target release notes
    • Target release notes (current)
    • Target release notes (prerelease)
    • Target documentation overview
    • System status updates and proactive notifications
    • Documentation changes
    • Release notes for previous releases
  • Introduction
    • Introduction to Target
    • Access Target from the Adobe Experience Cloud
    • Target key concepts
    • Understand the Target UI
    • Target UI update FAQs
    • Adobe Target AI Assistant
      • AI Assistant overview
      • Enable AI Assistant
      • Use AI Assistant to gain product knowledge
    • Adobe Target welcome kit
      • Target welcome kit overview
      • Chapter 1: Introduction
      • Chapter 2: Target at a glance
      • Chapter 3: Develop your testing and personalization ideas
      • Chapter 4: Tips for using Target
      • Chapter 5: Inspiration for testing and personalization activities
      • Chapter 6: Easily avoidable pitfalls
      • Chapter 7: Create and run your first Target activity
      • Chapter 8: Communicate your activity results
      • Chapter 9: Next steps and resources
    • Glossary
    • How Target works
    • Training and certification
    • Training videos for Target Standard and Premium
    • Target optimization and personalization FAQ
  • Administer Target
    • Administer Target overview
    • Administrator first steps
    • Configure the Visual Experience Composer
    • Reporting
      • Configure reporting
      • Estimating lift in revenue
    • Scene7 configuration
    • Implementation
    • Hosts
    • Environments
    • Response tokens
    • Manage users
      • User management
      • Users
        • Users overview
        • Troubleshoot user management
      • Enterprise user permissions
        • Enterprise user permissions
        • Configure enterprise permissions
        • Grant Adobe I/O integrations access to workspaces and assign roles
    • Recommendations
  • Implement Target
    • Implement Target overview
  • Integrate Target with the Experience Cloud
    • Adobe Analytics as the reporting source for Target (A4T)
      • A4T overview
      • Before you implement
      • Analytics for Target implementation
      • User permission requirements
      • Create an activity that uses Analytics as the reporting source
      • A4T support for Auto-Allocate and Auto-Target activities
      • Use an Analytics tracking server
      • A4T reporting
      • Troubleshooting the Analytics and Target integration (A4T)
        • Troubleshoot A4T
      • A4T Frequently Asked Questions
        • Initial provisioning - A4T FAQ
        • Activity settings - A4T FAQ
        • View reports - A4T FAQ
        • Redirect offers - A4T FAQ
        • Lift and confidence - A4T FAQ
        • Metric definitions - A4T FAQ
        • Classifications - A4T FAQ
        • Share metrics, audiences, and reports - A4T FAQ
        • Legacy SiteCatalyst to Test&Target Integration - A4T FAQ
      • Expected data variances between Target and Analytics when using and not using A4T
    • Integrate Target with Adobe Customer Journey Analytics
      • Target reporting in Adobe Customer Journey Analytics
    • Integrate Target with Adobe Journey Optimizer (AJO)
      • Use offer decisions
    • Experience Cloud Audiences
    • Integrate Target with Adobe Experience Manager (AEM)
      • Integrate Target with AEM overview
      • Experience Fragments and Content Fragments
        • AEM Experience Fragments and Content Fragments overview
        • AEM Experience Fragments
        • AEM Content Fragments
    • Integrate Target with Adobe Audience Manager (AAM)
    • Integrate with Real-time Customer Data Platform
    • Integrate Target with Adobe Campaign
  • Activities
    • Activities overview
    • Insights Dashboard
    • Target activity types
    • A/B Test
      • A/B test overview
      • How long should you run an A/B test?
      • Ten common A/B testing pitfalls and how to avoid them
      • A/A testing
      • Create an A/B test
        • Create an A/B test
        • Activity URL
        • Add experience
        • Select audience
        • Goals and settings
        • Use Analytics Data
        • Set metrics
        • Multiple experience audiences in an A/B Test
    • Auto-Allocate
      • Auto-Allocate overview
      • Create an Auto-Allocate activity
      • Interpret Auto-Allocate reports
      • Auto-Allocate can give you faster test results and higher revenue than a manual test
    • Auto-Target
      • Auto-Target overview
      • Create an Auto-Target activity
      • Auto-Target FAQs and troubleshooting
      • Reporting and Auto-Target
    • Automated Personalization
      • Automated Personalization overview
      • Random Forest Algorithm
      • Create an Automated Personalization activity
      • Upload data for the Target personalization algorithms
      • Data collection for the Target personalization algorithms
      • Estimate the traffic required for success
      • Preview experiences for an Automated Personalization test
      • Target Automated Personalization offers
      • Manage exclusions
      • Offer reporting groups in Automated Personalization
      • Select the control for your Automated Personalization or Auto-Target activity
      • Automated Personalization FAQ
      • Troubleshoot Automated Personalization
    • Experience Targeting
      • Experience Targeting overview
      • Create an Experience Targeting activity
        • Create an activity
        • Activity URL
        • Create an experience
        • Switching experiences in Experience Targeting
        • Goals and settings
        • Set metrics
    • Multivariate Test
      • Multivariate Test overview
      • Multivariate Test best practices
      • Plan a Multivariate Test
      • Create a Multivariate Test
        • Create a test
        • Activity URL
        • Create combinations
        • Preview experiences for a Multivariate Test
        • Estimate the traffic required for a successful test
        • Test summary
        • Goals and settings
        • Set metrics
        • Troubleshoot Multivariate Tests
    • Recommendations activity
    • Edit an activity
    • Priority
    • Activity settings
    • Success metrics
      • Success metrics
      • Click tracking
      • Capture score
    • Activity change log
    • Troubleshoot activities
      • Troubleshoot activities overview
      • Troubleshoot content delivery
    • Activity QA
      • Activity QA overview
      • Activity QA bookmarklet
      • Use Activity QA with server-side delivery
  • Audiences
    • Audiences overview
    • Create audiences
      • Create audiences overview
      • Build audiences in Target
      • Categories for audiences
        • Categories for audiences overview
        • Browser
        • Custom parameters
        • Geo
        • Network
        • Mobile
        • Operating System
        • Site Pages
        • Target Library
        • Time Frame
        • Traffic Sources
        • Visitor Profile
      • Create a profile attribute comparison audience
    • Combine multiple audiences
    • Create an activity-only audience
    • Audience filters for reporting
    • Apply a reporting audience to a success metric
    • Visitor profiles
      • Visitor profiles overview
      • Visitor profile lifetime
      • Profile attributes
      • Use profile scripts to test mutually exclusive activities
      • Category affinity
      • Customer attributes
      • Real-time profile syncing for mbox3rdPartyId
      • Profile and variable glossary
    • Targets and audiences FAQ
      • Targets and audiences FAQ
  • Experiences and offers
    • Experiences and offers overview
    • Visual Experience Composer (VEC)
      • Visual Experience Composer overview
      • Visual Experience Composer options
      • Visual Experience Composer changes
      • Include the same experience on similar pages
      • Multipage activity
      • Activity collisions
      • Modifications
        • Modifications overview
        • Experience templates
      • Element selectors used in the Visual Experience Composer
      • Mobile viewports for responsive experiences
      • Visual Experience Composer best practices and limitations
      • Troubleshooting the Visual Experience Composer
        • Troubleshooting the Visual Experience Composer overview
        • Troubleshooting the Visual Experience Composer and Enhanced Experience Composer
        • Troubleshooting the Visual Experience Composer
        • Troubleshooting the Enhanced Experience Composer
        • Enabling mixed content in your browser
        • Page modification scenarios
        • Visual Editing Helper extension
        • Visual Experience Composer helper extension
      • Redirect to a URL
      • Creating carousels that work in the Visual Experience Composer
    • Form-Based Experience Composer
    • Single Page App (SPA) Visual Experience Composer
    • Offers
      • Offers overview
      • Create offer folder
      • Upload content
      • Create redirect offers
      • Create remote offers
      • Create JSON offers
      • Work with content in the library
      • Search and filter content
      • Pass dynamic data into offers
      • AEM Experience and Content Fragments
  • Reports
    • Reports overview
    • Report settings
      • Report settings overview
      • View multiple metrics in a report
      • Exclude extreme values
      • Downloading data in a CSV file
    • Statistical methodology
      • Statistical calculations in A/Bn tests
    • Personalization reports
      • Auto-Target Summary report
      • Automated Personalization Summary reports
    • Personalization Insights report
      • Personalization Insights reports overview
      • Automated Segments report
      • Important Attributes report
    • Multivariate Test reports
      • Experience Performance report (MVT)
      • Location Contribution report (MVT)
    • Analytics for Target (A4T) reporting
    • Reporting FAQ
  • Recommendations
    • Recommendations overview
    • Introduction to Recommendations
    • Plan and implement Recommendations
    • Entities
      • Entities overview
      • Entity attributes
      • Custom entity attributes
      • Feeds
      • Catalog search
      • Collections
      • Exclusions
    • Criteria
      • Criteria overview
      • Create criteria
      • Create criteria sequences
      • Base the recommendation on a recommendation key
      • The science behind Target’s recommendations algorithms
      • Upload custom criteria
      • Dynamic and static inclusion rules
        • Use dynamic and static inclusion rules
        • Entity attribute matching
        • Profile attribute matching
        • Parameter matching
        • Static filter
      • Use a backup recommendation
      • Work with multi-value attributes
      • Use Adobe Analytics with Recommendations
    • Design
      • Design overview
      • Create a design
      • Design FAQ
      • Customize a design using Velocity
    • Activity
      • Create a Recommendations activity
      • Add promotions
      • Recommendations activity settings
    • Recommendations as an offer
    • Frequently asked questions
      • Recommendations FAQ
      • Integrate Recommendations with email
      • IP addresses used by Recommendations feed-processing servers
      • Recommendations Classic versus Recommendations activities in Target Premium
    • Recommendations Classic documentation
  • Troubleshoot Target
    • Troubleshoot Target
    • Limits
  • Target APIs
    • Adobe Target API overview
  • Resources and contact information
:host { display: block; }
Experience League

Learn

  • Courses
  • Playlists
  • Tutorials
  • Instructor-led training
  • Browse all learning content

AI training

  • AI training

Documentation

  • Documentation home
  • Experience Cloud release notes
  • Document Cloud release notes

Certifications

  • Certifications home

Events

  • Events home

Community

  • Community home
  • Community code of conduct
  • Community resources
  • Advocate programs
  • Advertising
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Experience Platform
  • Marketo Engage
  • Real-time CDP
  • Target
  • Workfront

Support

  • Experience Cloud Support
  • Document Cloud Support
  • Community forums

Resources

  • Adobe I/O
  • Adobe Status

Adobe Account

  • Profile
  • Bookmarked content

Adobe

  • About
  • Careers
  • Newsroom
  • Corporate responsibility
  • Investor Relations
  • Supply chain
  • Trust Center
  • Events
  • Diversity & Inclusion
  • Integrity
Copyright © 2026 Adobe. All Rights Reserved./Privacy/Terms of Use/Cookie preferences/Do not sell my personal information/ AdChoices
Cookie preferences
Was this content helpful?

Was this content helpful?

Detailed feedback options
Other feedback options
Learn how to contribute.