为什么 Dreamweaver 向我的“a”添加图标元素?
我刚刚发现,在Adobe Dreamweaver CS3中,这个代码段在设计视图中看起来很好,
<a href="#">Test Anchor</a>
但是如果我向这个“a”标签添加一个“id”属性,就像这样,
<a id="test" href="#">Test Anchor</a>
在该代码段的左侧会有一个图标“a”元素,就像一本打开的书一样。 (我没有上传图片的权限)
这个图标是什么意思? Dreamweaver 有什么暗示吗?我尝试用谷歌搜索一些关键字组,但除了广告之外什么也没有得到。
有什么帮助吗?多谢!
I just found that, in Adobe Dreamweaver CS3, this code segment seems fine in the design view,
<a href="#">Test Anchor</a>
but if I add an "id" attribute to this "a" tag, like this,
<a id="test" href="#">Test Anchor</a>
there would be an icon at the left side of the "a" element, something just like an open book. (I have no privileges to upload image)
What is the meaning of the icon? Is there anything that Dreamweaver implies? I've tried to google some groups of keywords, and got nothing but ads.
Any help? Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此图标(应看起来像带有锚点的盾牌)是 Dreamweaver 设计视图指示器。该指标用于识别“命名”锚点。没有图像会上传到您的网站,所以不用担心。带有 ID 的 Anchor () 标记被视为“命名”,因为您可以在 URL 末尾添加哈希,以使浏览器“跳转”到命名/ided 元素。如果您的文件是 test.html 并且您使用 test.html#test 访问您的页面,那么浏览器将加载您的页面并“跳转”到指定的锚点。在最近的浏览器中(不确定多久以前,但可能足够远,现在不必太担心)具有 id 属性值的锚点将以与具有 name 属性值的锚点相同的方式工作。
如果您不喜欢在有几个选项时出现此图标:
编辑(Mac 上的 Dreamweaver)->首选项,不可见元素,取消选中命名锚点。
或查看->视觉教具 ->看不见的元素。此选项会关闭首选项中列出的所有不可见元素指示器,因此请确保您知道要关闭哪些内容。
This icon (should look like a shield with an anchor on it) is a Dreamweaver design view indicator. This indicator is used to identify "named" anchors. No image that will be uploaded to your site, so don't worry about that. Anchor () tags with an ID are considered "named" as you can add a hash to the end of your URL to have the browser "jump" to the named/ided element. If you file is test.html and you visit your page with test.html#test then the browser will load up your page and "jump" to the named anchor. In recent browsers (not sure how far back, but likely far enough to not worry too much about it now) anchors with an id attribute value will work in the same manner as those with a name attribute value.
If you do not like this icon appearing when you have a couple of options:
Edit (Dreamweaver on Mac) -> Preferences, Invisible Elements, uncheck Named anchors.
Or View -> Visual Aids -> Invisible Elements. This option turns off all invisible element indicators listed in the preferences, so make sure you know what things your turning off.
它可能只是使用符号来识别页面上作为链接的文本,保存文件并将其加载到您的网络浏览器中,很可能该图标实际上并不是您代码的一部分。
It's probably just using the symbol to identify text on the page that's a link, save the file and load it up in your web browser, chances are the icon isn't actually part of your code.