{"id":65323,"date":"2007-03-14T01:41:00","date_gmt":"2007-03-14T01:41:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2007\/03\/14\/how-can-i-use-graphics-in-an-htas-bulleted-list\/"},"modified":"2007-03-14T01:41:00","modified_gmt":"2007-03-14T01:41:00","slug":"how-can-i-use-graphics-in-an-htas-bulleted-list","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/how-can-i-use-graphics-in-an-htas-bulleted-list\/","title":{"rendered":"How Can I Use Graphics in an HTA\u2019s Bulleted List?"},"content":{"rendered":"<p><H2><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" height=\"34\" alt=\"Hey, Scripting Guy! Question\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\"> <\/H2>\n<P>Hey, Scripting Guy! Often-times while browsing the Internet I run across Web pages where they used a bulleted list, except that they use little pictures as the bullets. Can I add that type of a bulleted list to my HTAs?<BR><BR>&#8212; JA<\/P><IMG height=\"5\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" border=\"0\"><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" height=\"34\" alt=\"Hey, Scripting Guy! Answer\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\"><A href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><IMG class=\"farGraphic\" title=\"Script Center\" height=\"288\" alt=\"Script Center\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" align=\"right\" border=\"0\"><\/A> \n<P>Hey, JA. You know, as a long-time baseball coach, the Scripting Guy who writes this column knows exactly how to answer that question: That\u2019s up to you, JA; do <I>you<\/I> believe that you can add that type of bulleted list to your HTAs? The truth is, the only thing that can stop you from adding that type of bulleted lists to your HTAs is yourself. As the immortal <A href=\"http:\/\/www.leapfrog-entertainment.com\/Artists\/Big\/Mcharlie\/Mcharlie.htm\" target=\"_blank\"><B>Magic Charlie<\/B><\/A> so aptly put it, \u201cAnything you can conceive and believe, you can achieve.\u201d<\/P>\n<P>Of course, we should note that, as a long-time baseball coach, the Scripting Guy who writes this column knows that none of that is really true. It\u2019s great that you want to be a shortstop and it\u2019s great that you truly <I>believe<\/I> that you can be a shortstop. However, it\u2019d be even <I>better<\/I> if you could field ground balls and make the throw to first base. When it comes to playing shortstop, it\u2019s not enough to <I>believe<\/I> that you can turn the double play; you have to actually be <I>able<\/I> to turn the double play.<\/P>\n<P>Unless, of course, you play for the Seattle Mariners. In that case, actual ability seems to be optional.<\/P>\n<P>So, in other words, no, JA, you <I>can\u2019t<\/I> add that type of a bulleted list to your HTAs; it\u2019s just not going to happen.<\/P>\n<P>Well, not unless you use code like this, that is:<\/P><PRE class=\"codeSample\">&lt;html&gt;<\/p>\n<p>&lt;head&gt;\n    &lt;style&gt;\n        ul \n        {list-style-image: url(&#8220;bullet.gif&#8221;)}\n    &lt;\/style&gt;\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;\n    &lt;ul&gt;\n        &lt;li&gt;This is the first item in the list.&lt;\/li&gt;\n        &lt;li&gt;This is the second item in the list.&lt;\/li&gt;\n        &lt;li&gt;This is the third item in the list.&lt;\/li&gt;\n    &lt;\/ul&gt;\n&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;\n<\/PRE>\n<P>As it turns out, there are two things you need to do to create a bulleted list that uses pictures as the bullet. To begin with, you need to have a picture that you can use as a bullet; in our case that happens to be a graphics file named Bullet.gif, stored in the same folder as our HTA. Second, you need to create a style for the &lt;UL&gt; tag, the HTML element that creates a bulleted list. That style should look something like this:<\/P><PRE class=\"codeSample\">&lt;style&gt;\n    ul \n    {list-style-image: url(&#8220;bullet.gif&#8221;)}\n&lt;\/style&gt;\n<\/PRE>\n<P>As you can see, what we\u2019ve done here is define a global style that uses the file Bullet.gif for all the bulleted lists found in our HTA. To make that happen we define the style by specifying the desired HTML tag (&lt;UL&gt;) followed by the property values to be assigned to that tag. In this case we\u2019re assigning a value to the <B>list-style-image<\/B> attribute, with that value being the <B>url<\/B> parameter followed by the location of the graphics file.<\/P>\n<P>Believe it or not, that\u2019s all we need to do. When we start this HTA any and all of our bulleted lists will use the file Bullet.gif as the bullet character:<\/P><IMG height=\"239\" alt=\"HTA\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/gbullet1.jpg\" width=\"339\" border=\"0\"> \n<P><BR>You know, we never thought of that: what if we <I>did<\/I> want to use different bullet styles for different lists? Well, one way to do that is to use a so-called \u201cinline style\u201d rather than a globally-defined style. For example, take a look at the following HTA code; in this case we have one bulleted list that uses a graphic as the bullet and one list that doesn\u2019t use a graphic as a bullet:<\/P><PRE class=\"codeSample\">&lt;html&gt;<\/p>\n<p>&lt;body&gt;\n    &lt;ul style=&#8221;list-style-image: url(&#8216;bullet.gif&#8217;)&#8221; &gt;\n        &lt;li&gt;This is the first item in the list.&lt;\/li&gt;\n        &lt;li&gt;This is the second item in the list.&lt;\/li&gt;\n        &lt;li&gt;This is the third item in the list.&lt;\/li&gt;\n    &lt;\/ul&gt;\n    &lt;p&gt;\n    &lt;ul&gt;\n        &lt;li&gt;This is the first item in the list.&lt;\/li&gt;\n        &lt;li&gt;This is the second item in the list.&lt;\/li&gt;\n        &lt;li&gt;This is the third item in the list.&lt;\/li&gt;\n    &lt;\/ul&gt;\n&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;\n<\/PRE>\n<P>Notice that, this time around, we didn\u2019t define a global style. Instead, we specified the value for the list-style-image attribute when we actually added the bulleted list to the HTA:<\/P><PRE class=\"codeSample\">&lt;ul style=&#8221;list-style-image: url(&#8216;bullet.gif&#8217;)&#8221; &gt;\n<\/PRE>\n<P>Compare that syntax to the syntax for the second bulleted list in the HTA:<\/P><PRE class=\"codeSample\">&lt;ul&gt;\n<\/PRE>\n<P>Because there is no style parameter here, and because there is no global style defined for bulleted lists, we get the default bullet format. In turn, that means our HTA looks like this:<\/P><IMG height=\"239\" alt=\"HTA\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/gbullet2.jpg\" width=\"339\" border=\"0\"> \n<P><BR>By using inline styles you can have as many different types of bulleted lists as you, well, have bulleted lists.<\/P>\n<P>If you don\u2019t like dealing with graphics you can also use the <B>list-style-type<\/B> attribute to modify the look of your bulleted lists. The list-style-type attribute accepts the following values:<\/P>\n<TABLE class=\"dataTable\" id=\"EAF\" cellSpacing=\"0\" cellPadding=\"0\">\n<THEAD><\/THEAD>\n<TBODY>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\"><B>Value<\/B><\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\"><B>Description<\/B><\/P><\/TD><\/TR>\n<TR class=\"evenRecord\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">disc<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">Default. Solid circles.<\/P><\/TD><\/TR>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">circle<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">Outlined circles.<\/P><\/TD><\/TR>\n<TR class=\"evenRecord\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">square<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">Solid squares.<\/P><\/TD><\/TR>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">decimal<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">1, 2, 3, 4, and so on.<\/P><\/TD><\/TR>\n<TR class=\"evenRecord\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">lower-roman<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">i, ii, iii, iv, and so on.<\/P><\/TD><\/TR>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">upper-roman<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">I, II, III, IV, and so on.<\/P><\/TD><\/TR>\n<TR class=\"evenRecord\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">lower-alpha<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">a, b, c, d, and so on.<\/P><\/TD><\/TR>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">upper-alpha<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">A, B, C, D, and so on.<\/P><\/TD><\/TR>\n<TR class=\"evenRecord\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\">none<\/P><\/TD>\n<TD class=\"\">\n<P class=\"lastInCell\">No marker is shown.<\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<DIV class=\"dataTableBottomMargin\"><\/DIV>\n<P>For example, suppose you define a new bulleted list using this syntax:<\/P><PRE class=\"codeSample\">&lt;ul style=&#8221;list-style-type: &#8216;lower-roman'&#8221;&gt;\n<\/PRE>\n<P>That\u2019s going to give you a bulleted list that looks like this:<\/P><IMG height=\"239\" alt=\"HTA\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/gbullet3.jpg\" width=\"339\" border=\"0\"> \n<P><BR>Not too bad, not too bad at all.<\/P>\n<P>Incidentally, list-image-style and list-style-type are just two of the many attributes available to you when using Cascading Style Sheets (CSS). For more information, take a look at the <A href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms531205.aspx\" target=\"_blank\"><B>CSS Reference<\/B><\/A> information found on MSDN.<\/P>\n<P>So apparently Magic Charlie was right after all: whatever you can conceive and believe you really <I>can<\/I> achieve. Unless you want to get technical about it, in which case you\u2019d have to amend that to read \u201cWhatever you can conceive and believe and the Scripting Guys can achieve you can then copy and paste into your HTA and use it as if you\u2019d created it yourself.\u201d But not only is that a bit of a mouthful, but it doesn\u2019t rhyme, either. Maybe that\u2019s why Magic Charlie decided to use <I>Whatever you can conceive and believe, you can achieve<\/I> instead. Once again we fail to get the credit we so richly deserve simply because it\u2019s hard to find anything that rhymes with <I>Scripting Guys<\/I>.<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! Often-times while browsing the Internet I run across Web pages where they used a bulleted list, except that they use little pictures as the bullets. Can I add that type of a bulleted list to my HTAs?&#8212; JA Hey, JA. You know, as a long-time baseball coach, the Scripting Guy who writes [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3,4,5,30],"class_list":["post-65323","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-scripting-guy","tag-scripting-techniques","tag-vbscript","tag-web-pages-and-htas"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! Often-times while browsing the Internet I run across Web pages where they used a bulleted list, except that they use little pictures as the bullets. Can I add that type of a bulleted list to my HTAs?&#8212; JA Hey, JA. You know, as a long-time baseball coach, the Scripting Guy who writes [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/65323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=65323"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/65323\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=65323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=65323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=65323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}