<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Smart Copy and CSS Selectors in Blog, Website &amp; Page Publishing</title>
    <link>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Smart-Copy-and-CSS-Selectors/m-p/364148#M3886</link>
    <description>&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/td-p/364142" target="_blank" rel="noopener"&gt;Smart Copy&lt;/A&gt; automatically imports your blog into HubSpot by using a combination of &lt;/SPAN&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/CSS" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;CSS&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.google.com/search/docs/guides/intro-structured-data" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;schema markup&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;, and &lt;/SPAN&gt;&lt;A href="https://www.w3schools.com/tags/tag_meta.asp" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;meta tag&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt; selectors to find all your blog post features (e.g., author, title, post body, etc.).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;However, blogs across the web are built with different markup depending on the developer or the CMS. This can sometimes make it difficult for the tool to read the blog template’s markup. In these cases, we ask you to manually enter a CSS selector that will help us import that feature.&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;But first of all, what is a CSS Selector? &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;CSS selectors&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt; identify HTML elements on a webpage so that they can be targeted by other code, such as CSS stylesheets or JavaScript. The main types of CSS selectors are: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;STRONG&gt;Tag&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; - A tag/type selector is the name of the tag &amp;lt;&amp;gt;. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples:&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div span p h1 h6&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;STRONG&gt;Class&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; - A class selector is the name of the class preceded by a dot. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples:&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.featuredContent .blog_banner .blog-title&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; - An ID selector is the name of the ID preceded by a hashtag. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples:&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;#post-title #blog-content #news_heading34&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ruthfarrell_0-1598277776049.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/30618i73C73516DA642CC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="ruthfarrell_0-1598277776049.png" alt="ruthfarrell_0-1598277776049.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;By inputting a CSS selector within Smart Copy, you’re giving us the information we need to import the right feature into your HubSpot blog.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;How can I find a CSS Selector?&amp;nbsp;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;We cover finding CSS selectors using the Chrome browser in the &lt;/SPAN&gt;&lt;A href="https://knowledge.hubspot.com/blog/import-your-blog-into-hubspot#troubleshoot-mappings-add-css-selector" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Smart Copy Knowledge Base article&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;. This article includes links to developer resources for other web browsers.&amp;nbsp; There are also &lt;/SPAN&gt;&lt;A href="https://chrome.google.com/webstore/detail/css-selector-helper-for-c/gddgceinofapfodcekopkjjelkbjodin?hl=en" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Chrome extensions&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt; that can help you to find and copy a CSS selector. For the best results, refer to the documentation for the web browser you’re using.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;However, when working with Smart Copy, it’s not sufficient to find and copy &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;any&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; CSS selector. It’s important to find a &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;good&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; CSS selector, which often involves inspecting the source code of your blog.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;What makes a &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;good&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; CSS Selector?&amp;nbsp;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;A good CSS selector is one that is both broad enough to work on every blog post, while also being specific enough to identify the right content.&amp;nbsp; Consider the examples below: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Blog Post 1: &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-post-container"&amp;gt;
  &amp;lt;h1&amp;gt;My Blog Post Title About CSS&amp;lt;/h1&amp;gt;
    &amp;lt;div class="blog-post-content" id="post-about-CSS"&amp;gt; 
      My blog post content for the post: My Blog Post Title About CSS, is contained here.
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Blog Post 2: &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-post-container"&amp;gt;
  &amp;lt;h1&amp;gt;My Blog Post Title About JS&amp;lt;/h1&amp;gt;
    &amp;lt;div class="blog-post-content" id="post-about-JS"&amp;gt; 
      My blog post content for the post: My Blog Post Title About JS, is contained here.
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Say we are looking for Smart Copy to target the blog post body content across our blog. In this case, there are three potential CSS selectors to choose from: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 1: The tag &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 2: The class &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 3: The ID &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;#post-about-CSS&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Even though there are three CSS selectors to choose from, there’s one CSS selector that will work best. Let’s break down each option below:&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 1: The tag &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is too &lt;/SPAN&gt;&lt;STRONG&gt;broad,&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; as there are multiple divs in the source code — the div surrounding the blog post content: &amp;lt;div class=”blog-post-container”&amp;gt;,&amp;nbsp; for example. In this instance, Smart Copy would find the first occurrence of “div” on the page and then select not only the blog post content, but also the &amp;lt;h1&amp;gt; containing the blog post title. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 2: The ID &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;#post-about-CSS-selectors-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is too &lt;/SPAN&gt;&lt;STRONG&gt;specific&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; as if we look at the source code of the second blog post, the ID is different. We want to be able to select the blog post content in &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;every&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; blog post and not just in the first blog post.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 3: In this case, the class &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is the best&lt;/SPAN&gt; &lt;SPAN style="font-weight: 400;"&gt;CSS selector because it exists on every div that only contains blog post content. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;There may also be a time when you need to use a &lt;/SPAN&gt;&lt;STRONG&gt;parent selector&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; to target the correct feature.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;If we refer to the example source code below, we can see that the HTML element &amp;lt;div&amp;gt; with the class &lt;FONT color="#FF6600"&gt;.blog-post-content&lt;/FONT&gt; now contains two HTML elements, one &amp;lt;div&amp;gt; with author information that we don’t want to be included within the blog post content, and one &amp;lt;p&amp;gt;, paragraph, with the actual blog post content. &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-post-container"&amp;gt;
  &amp;lt;h1&amp;gt;My Blog Post Title About JS&amp;lt;/h1&amp;gt;
    &amp;lt;div class="blog-post-content" id="post-about-JS"&amp;gt; 
      &amp;lt;div class="author-name"&amp;gt;My author information &amp;lt;/div&amp;gt; 
      &amp;lt;p&amp;gt;My blog post content for the post: My Blog Post Title About JS, is contained here.&amp;lt;/p&amp;gt; 
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;In this case, we can use &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; as the parent selector for the &amp;lt;p&amp;gt; tag containing the blog post content, using a combination of a class and tag selector to achieve our goal. In this case &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content p&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is a&lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt; good &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt;CSS selector. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;For best results, choose a selector that can target the feature on all blog posts, but at the same time is specific enough to target the exact feature that you’re looking to import.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Smart Copy will help you along the way by displaying the value that your CSS selector found.&amp;nbsp; You can use this to confirm the accuracy of your selector: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ruthfarrell_1-1598277776005.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/30619i4496230728C03989/image-size/large?v=v2&amp;amp;px=999" role="button" title="ruthfarrell_1-1598277776005.png" alt="ruthfarrell_1-1598277776005.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;Tips &amp;amp; Tricks for CSS Selectors with Smart Copy&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;When choosing a CSS selector for your blog’s author or publish date, you can target an element that includes a little more content than just the author’s name or publish date. In these cases, Smart Copy will strip out everything else (e.g., “Posted”, “Published on”, “by“, special characters, punctuation marks, etc.) and will only import the date or the author’s name. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="publish-date"&amp;gt;Published on 06/05/2020&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;The CSS selector &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div.publish-date&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; will return 06/05/2020, even though the phrase "Published on" is also included in the same div.&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;span id="author-name"&amp;gt;Written by HubSpot&amp;lt;/span&amp;gt;&lt;/LI-CODE&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;The CSS selector &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;span#author-name&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; will return "HubSpot", even though the phrase "Written by" is also included in the same span.&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;When importing your blog post body, the Smart Copy tool won’t import any elements that have already been specified for other feature mappings (e.g. blog post title, or publish date). This does not apply to the featured image, which will still be included in your blog post body.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;When targeting the featured image, you can specify an &amp;lt;img&amp;gt; tag, a &amp;lt;div&amp;gt; that contains the &amp;lt;img&amp;gt; tag within it, or a &amp;lt;div&amp;gt; that has the featured image specified as a background image within its style attribute. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Example: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div id="banner-header" style="background-image: url('my-blog-image.jpg');"&amp;gt;
 &amp;lt;h1 class="banner-title"&amp;gt;Title&amp;lt;/h1&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;&lt;SPAN style="font-weight: 400;"&gt;The CSS selector &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div#banner-header&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; will return the image &lt;/SPAN&gt;&lt;A href="http://www.hubspot.com/featured-images/my-blog-image.jpg" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;my-blog-image.jpg&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;If tags are listed as separate &amp;lt;a&amp;gt; elements, you can input a selector for the &amp;lt;ul&amp;gt;, &amp;lt;section&amp;gt;, or &amp;lt;div&amp;gt; that immediately surrounds these &amp;lt;a&amp;gt; elements, and the Smart Copy tool will know to identify these as separate tags. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;Example: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-content blog-tags"&amp;gt;
  &amp;lt;ul&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Marketing&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Sales&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;a&amp;gt;CMS&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/LI-CODE&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;The CSS selector &lt;FONT color="#FF6600"&gt;div.blog-tags&lt;/FONT&gt; or &lt;FONT color="#FF6600"&gt;.blog-content ul&lt;/FONT&gt; will return the tags: Marketing, Sales and CMS. &lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Have further questions around finding selectors with Smart Copy, or having difficulties identifying the correct CSS selector? &lt;/SPAN&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/m-p/364142" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Leave a comment &lt;/STRONG&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/m-p/364142" target="_blank" rel="noopener"&gt;within the community post here&lt;/A&gt; to get more help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;Further Reading / Resources:&amp;nbsp;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/m-p/364142" target="_blank" rel="noopener"&gt;Information about Smart Copy&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://knowledge.hubspot.com/blog/import-your-blog-into-hubspot" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Knowledge Base Article about Smart Copy&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;What are CSS Selectors&lt;/SPAN&gt;&lt;/A&gt; &lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://ingohelp.zendesk.com/hc/en-us/articles/115002003554-Finding-Good-CSS-Selectors" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Finding Good CSS Selectors&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Aug 2020 16:02:43 GMT</pubDate>
    <dc:creator>ruthfarrell</dc:creator>
    <dc:date>2020-08-24T16:02:43Z</dc:date>
    <item>
      <title>Smart Copy and CSS Selectors</title>
      <link>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Smart-Copy-and-CSS-Selectors/m-p/364148#M3886</link>
      <description>&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/td-p/364142" target="_blank" rel="noopener"&gt;Smart Copy&lt;/A&gt; automatically imports your blog into HubSpot by using a combination of &lt;/SPAN&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/CSS" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;CSS&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.google.com/search/docs/guides/intro-structured-data" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;schema markup&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;, and &lt;/SPAN&gt;&lt;A href="https://www.w3schools.com/tags/tag_meta.asp" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;meta tag&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt; selectors to find all your blog post features (e.g., author, title, post body, etc.).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;However, blogs across the web are built with different markup depending on the developer or the CMS. This can sometimes make it difficult for the tool to read the blog template’s markup. In these cases, we ask you to manually enter a CSS selector that will help us import that feature.&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;But first of all, what is a CSS Selector? &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;CSS selectors&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt; identify HTML elements on a webpage so that they can be targeted by other code, such as CSS stylesheets or JavaScript. The main types of CSS selectors are: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;STRONG&gt;Tag&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; - A tag/type selector is the name of the tag &amp;lt;&amp;gt;. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples:&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div span p h1 h6&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;STRONG&gt;Class&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; - A class selector is the name of the class preceded by a dot. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples:&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.featuredContent .blog_banner .blog-title&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; - An ID selector is the name of the ID preceded by a hashtag. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples:&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;#post-title #blog-content #news_heading34&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ruthfarrell_0-1598277776049.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/30618i73C73516DA642CC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="ruthfarrell_0-1598277776049.png" alt="ruthfarrell_0-1598277776049.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;By inputting a CSS selector within Smart Copy, you’re giving us the information we need to import the right feature into your HubSpot blog.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;How can I find a CSS Selector?&amp;nbsp;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;We cover finding CSS selectors using the Chrome browser in the &lt;/SPAN&gt;&lt;A href="https://knowledge.hubspot.com/blog/import-your-blog-into-hubspot#troubleshoot-mappings-add-css-selector" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Smart Copy Knowledge Base article&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;. This article includes links to developer resources for other web browsers.&amp;nbsp; There are also &lt;/SPAN&gt;&lt;A href="https://chrome.google.com/webstore/detail/css-selector-helper-for-c/gddgceinofapfodcekopkjjelkbjodin?hl=en" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Chrome extensions&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt; that can help you to find and copy a CSS selector. For the best results, refer to the documentation for the web browser you’re using.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;However, when working with Smart Copy, it’s not sufficient to find and copy &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;any&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; CSS selector. It’s important to find a &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;good&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; CSS selector, which often involves inspecting the source code of your blog.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;What makes a &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;good&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; CSS Selector?&amp;nbsp;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;A good CSS selector is one that is both broad enough to work on every blog post, while also being specific enough to identify the right content.&amp;nbsp; Consider the examples below: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Blog Post 1: &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-post-container"&amp;gt;
  &amp;lt;h1&amp;gt;My Blog Post Title About CSS&amp;lt;/h1&amp;gt;
    &amp;lt;div class="blog-post-content" id="post-about-CSS"&amp;gt; 
      My blog post content for the post: My Blog Post Title About CSS, is contained here.
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Blog Post 2: &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-post-container"&amp;gt;
  &amp;lt;h1&amp;gt;My Blog Post Title About JS&amp;lt;/h1&amp;gt;
    &amp;lt;div class="blog-post-content" id="post-about-JS"&amp;gt; 
      My blog post content for the post: My Blog Post Title About JS, is contained here.
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Say we are looking for Smart Copy to target the blog post body content across our blog. In this case, there are three potential CSS selectors to choose from: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 1: The tag &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 2: The class &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 3: The ID &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;#post-about-CSS&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Even though there are three CSS selectors to choose from, there’s one CSS selector that will work best. Let’s break down each option below:&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 1: The tag &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is too &lt;/SPAN&gt;&lt;STRONG&gt;broad,&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; as there are multiple divs in the source code — the div surrounding the blog post content: &amp;lt;div class=”blog-post-container”&amp;gt;,&amp;nbsp; for example. In this instance, Smart Copy would find the first occurrence of “div” on the page and then select not only the blog post content, but also the &amp;lt;h1&amp;gt; containing the blog post title. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 2: The ID &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;#post-about-CSS-selectors-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is too &lt;/SPAN&gt;&lt;STRONG&gt;specific&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; as if we look at the source code of the second blog post, the ID is different. We want to be able to select the blog post content in &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt;every&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt; blog post and not just in the first blog post.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Option 3: In this case, the class &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is the best&lt;/SPAN&gt; &lt;SPAN style="font-weight: 400;"&gt;CSS selector because it exists on every div that only contains blog post content. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;There may also be a time when you need to use a &lt;/SPAN&gt;&lt;STRONG&gt;parent selector&lt;/STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt; to target the correct feature.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;If we refer to the example source code below, we can see that the HTML element &amp;lt;div&amp;gt; with the class &lt;FONT color="#FF6600"&gt;.blog-post-content&lt;/FONT&gt; now contains two HTML elements, one &amp;lt;div&amp;gt; with author information that we don’t want to be included within the blog post content, and one &amp;lt;p&amp;gt;, paragraph, with the actual blog post content. &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-post-container"&amp;gt;
  &amp;lt;h1&amp;gt;My Blog Post Title About JS&amp;lt;/h1&amp;gt;
    &amp;lt;div class="blog-post-content" id="post-about-JS"&amp;gt; 
      &amp;lt;div class="author-name"&amp;gt;My author information &amp;lt;/div&amp;gt; 
      &amp;lt;p&amp;gt;My blog post content for the post: My Blog Post Title About JS, is contained here.&amp;lt;/p&amp;gt; 
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;In this case, we can use &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; as the parent selector for the &amp;lt;p&amp;gt; tag containing the blog post content, using a combination of a class and tag selector to achieve our goal. In this case &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;.blog-post-content p&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; is a&lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-weight: 400;"&gt; good &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-weight: 400;"&gt;CSS selector. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;For best results, choose a selector that can target the feature on all blog posts, but at the same time is specific enough to target the exact feature that you’re looking to import.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Smart Copy will help you along the way by displaying the value that your CSS selector found.&amp;nbsp; You can use this to confirm the accuracy of your selector: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ruthfarrell_1-1598277776005.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/30619i4496230728C03989/image-size/large?v=v2&amp;amp;px=999" role="button" title="ruthfarrell_1-1598277776005.png" alt="ruthfarrell_1-1598277776005.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;Tips &amp;amp; Tricks for CSS Selectors with Smart Copy&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;When choosing a CSS selector for your blog’s author or publish date, you can target an element that includes a little more content than just the author’s name or publish date. In these cases, Smart Copy will strip out everything else (e.g., “Posted”, “Published on”, “by“, special characters, punctuation marks, etc.) and will only import the date or the author’s name. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Examples: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="publish-date"&amp;gt;Published on 06/05/2020&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;The CSS selector &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div.publish-date&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; will return 06/05/2020, even though the phrase "Published on" is also included in the same div.&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;span id="author-name"&amp;gt;Written by HubSpot&amp;lt;/span&amp;gt;&lt;/LI-CODE&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;The CSS selector &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;span#author-name&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; will return "HubSpot", even though the phrase "Written by" is also included in the same span.&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;When importing your blog post body, the Smart Copy tool won’t import any elements that have already been specified for other feature mappings (e.g. blog post title, or publish date). This does not apply to the featured image, which will still be included in your blog post body.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;When targeting the featured image, you can specify an &amp;lt;img&amp;gt; tag, a &amp;lt;div&amp;gt; that contains the &amp;lt;img&amp;gt; tag within it, or a &amp;lt;div&amp;gt; that has the featured image specified as a background image within its style attribute. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;Example: &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div id="banner-header" style="background-image: url('my-blog-image.jpg');"&amp;gt;
 &amp;lt;h1 class="banner-title"&amp;gt;Title&amp;lt;/h1&amp;gt;
&amp;lt;/div&amp;gt; &lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;&lt;SPAN style="font-weight: 400;"&gt;The CSS selector &lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN style="font-weight: 400;"&gt;div#banner-header&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="font-weight: 400;"&gt; will return the image &lt;/SPAN&gt;&lt;A href="http://www.hubspot.com/featured-images/my-blog-image.jpg" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;my-blog-image.jpg&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="font-weight: 400;"&gt;If tags are listed as separate &amp;lt;a&amp;gt; elements, you can input a selector for the &amp;lt;ul&amp;gt;, &amp;lt;section&amp;gt;, or &amp;lt;div&amp;gt; that immediately surrounds these &amp;lt;a&amp;gt; elements, and the Smart Copy tool will know to identify these as separate tags. &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;SPAN style="font-weight: 400;"&gt;Example: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="blog-content blog-tags"&amp;gt;
  &amp;lt;ul&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Marketing&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Sales&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;a&amp;gt;CMS&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/LI-CODE&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;FONT size="3"&gt;The CSS selector &lt;FONT color="#FF6600"&gt;div.blog-tags&lt;/FONT&gt; or &lt;FONT color="#FF6600"&gt;.blog-content ul&lt;/FONT&gt; will return the tags: Marketing, Sales and CMS. &lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Have further questions around finding selectors with Smart Copy, or having difficulties identifying the correct CSS selector? &lt;/SPAN&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/m-p/364142" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Leave a comment &lt;/STRONG&gt;&lt;/A&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/m-p/364142" target="_blank" rel="noopener"&gt;within the community post here&lt;/A&gt; to get more help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="font-weight: 400;"&gt;Further Reading / Resources:&amp;nbsp;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;A href="https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Import-blog-posts-into-HubSpot-from-any-CMS-with-Smart-Copy/m-p/364142" target="_blank" rel="noopener"&gt;Information about Smart Copy&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://knowledge.hubspot.com/blog/import-your-blog-into-hubspot" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Knowledge Base Article about Smart Copy&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;What are CSS Selectors&lt;/SPAN&gt;&lt;/A&gt; &lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://ingohelp.zendesk.com/hc/en-us/articles/115002003554-Finding-Good-CSS-Selectors" target="_blank" rel="noopener"&gt;&lt;SPAN style="font-weight: 400;"&gt;Finding Good CSS Selectors&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 16:02:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Smart-Copy-and-CSS-Selectors/m-p/364148#M3886</guid>
      <dc:creator>ruthfarrell</dc:creator>
      <dc:date>2020-08-24T16:02:43Z</dc:date>
    </item>
  </channel>
</rss>

