【问题标题】:Why href and <a> tag not working using sublime 3?为什么使用 sublime 3 时 href 和 <a> 标签不起作用?
【发布时间】:2017-11-02 23:09:39
【问题描述】:

我刚刚开始学习如何使用 HTML 来学习如何构建一个网站,最终目标是弄清楚如何实施谷歌分析标签,以便更好地了解我朝九晚五的工作是如何工作的.

到目前为止,HTML 似乎很简单,但是当我使用“”或 href 标记时,在 chrome 中打开文件时似乎没有出现任何内容。

我一直在使用 sublime 3 作为文本编辑器,在我写了几行 html 并尝试保存它之后,它确实弹出了关于购买软件或其他东西的信息(对不起,我没有完全阅读该消息在关闭它之前)。所以我不确定这是否与 sublime 3 或我的编码有关。这可能是我所做的非常简单和愚蠢的事情,因此我们将不胜感激。

HTML 代码如下:

<html>

<head>
    <title>MY WEBPAGE!</title>
</head>

<body>

    <h1>Yo! Sup!</h1>   

    <h2>you can use header tags to create big heads in size 1-6</h2>

        <br> <img src="https://i.ytimg.com/vi/dGpZEuXoFWw/hqdefault.jpg">

    <br>  <br> You need to use br tag to create a new line

        <p>You can write in <strong>bold</strong>
            <br> You can also write in <em>italics</em>
            <br> Can you do <em><strong>both?</strong></em>
        </p>

    <p>You don't always have to use double br tags to start a new paragraph you can use the p tag, the good thing about p tag is it creates a space either side of the paragraph
    </p>

    What about underline?

    <br> <br> You can use the a tag to link to another site <a google.com></a>

    <br> <br> but you need to add a href in <a href="www.google.co.uk"></a>

    <br> <br> You can also you the img tag to identify an image source 

    <br> <br> you can create an unordered list using the ul and li tags which are used to create lists for drop downs and navigations

    <br> <br> 

    <ul>

        <li> first list item </li>

        <li> second list item </li>

        <li> third list item </li>

    </ul>

    <br> you can create an ordered list (which basically just gives the list numbers) by using the ol tag

    <ol>

        <li> first list item </li>

        <li> second list item </li>

        <li> third list item </li>

    </ol>

</body>

</html>

谢谢!

【问题讨论】:

  • 您需要在 标签之间放置文本 google
  • &lt;a href="https://google.com"&gt;google.com&lt;/a&gt;,而不是 &lt;a google.com&gt;&lt;/a&gt;。需要告诉标签它链接到哪里以及页面应该显示什么文本。这也与您用于编辑文本的软件无关,因为它的价值。您看到的消息是 Sublime 每隔几次保存就会弹出一些信息,提醒您如果决定继续使用它,您应该购买它。除了烦人之外,这对任何事情都没有影响。
  • 完美!谢谢!

标签: html sublimetext3 href


【解决方案1】:

你需要在那个标签里面放一些文本!比如

&lt;a href="http://google.com"&gt;Google&lt;/a&gt;

【讨论】:

  • 啊!优秀的!谢谢你,米卡,我知道我这样做很愚蠢。
猜你喜欢
  • 2014-05-14
  • 1970-01-01
  • 2020-10-24
  • 1970-01-01
  • 1970-01-01
  • 2020-10-29
  • 1970-01-01
  • 2015-03-11
  • 2022-10-17
相关资源
最近更新 更多