headfirst html css(1)(2)

第一個程序

<html>
<head>
    <title>Starbuzz Coffee Beverages</title>
    <style>
    body{
        background-color:#d2b48c;
        margin-left:20%;
        margin-right:20%;
        border:2px dotted black;
        padding:10px 10px 10px 10px;
        font-family:sans-serif;
    }
    </style>
</head>
<body>
        <h1>Starbuzz Coffee Beverages</h1>
        <h2>House Blend,$1.49</h2>
        <p>A smooth,milm blend of coffee from Mexico,Bolivia and Guatemala.</p>


        <h2>Mocha Cafe Latte,$2.35</h2>
        <p>Espresso,steamed milk and chocolate syrup.</p>

        <h2>Cappuccino,$1.89</h2>
        <p>A mixture of espresso,steamed milk and foam.</p>

        <h2>Chai Tea,$1.85</h2>
        <p>A spicy drink made with black tea,spices,milk and honey.</p>
</body>
</html>

效果:

Paste_Image.png
  1. 沒有使用編輯器軟件,用的MAC自帶的文本編輯。
    要在偏好設(shè)置中設(shè)置為“純文本”。
    并且在編輯中關(guān)閉“智能引號”功能。

第二章(主要講的圖片及超鏈接的引入方式)

<html>
  <head>
    <title>Head First Lounge</title>
  </head>
  <body>
    <h1>Welcome to the New and Improved Head First Lounge</h1>
    <a href="directions.html"><img src="2/drinks.gif"></a>
    <p>
      Join us any evening for refreshing elixirs, 
    refreshing <a href="1/elixir.html">elixirs</a>,
      conversation and maybe a game or two of 
      <em>Dance Dance Revolution</em>.  
      Wireless access is always provided;  
      BYOWS (Bring Your Own Web Server).
    </p>
    <h2>Directions</h2>
    <p>
      You'll find us right in the center 
      of downtown Webville.
    If you need help finding us,check our
    <a href="1/directions.html">detailed directions</a>
      Come join us!
    </p>
  </body>
</html>

一個例子就可以說明:

<a href="directions.html"><img src="2/drinks.gif"></a>

效果為點擊圖片,就可以打開連接。
被夾在a 和/a之間的內(nèi)容的變?yōu)殒溄印?/p>

相對路徑:

為了找到html文件和圖片。以你所在的文件的視角尋找目標(biāo)。

../drinks.gif

".."表示去上一層路徑。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,241評論 0 23
  • 夜 照亮了天空 星 劃破了蒼穹 一切都閃著亮光 指引著方向 風(fēng) 輕撫了臉龐 雨 澆灌了內(nèi)心 一切都刺著寒冷 指引著...
    劃一座城池閱讀 147評論 0 1
  • 古人常說讀萬卷書,行萬里路??傆X得身心總得有一個保持在路上。 也許對旅行無感的朋友會說去那么多地方,...
    這故事未完待續(xù)閱讀 252評論 0 2
  • 遇你是我注定的災(zāi)難 途經(jīng)嫣紅牽引的指南 玫瑰無心傷了河畔 噢,就在你的花園 連星河也碎了 漫天星辰愛你至黃昏的時間...
    治百病的草閱讀 136評論 0 2
  • 玉兔偷花花竊酒, 春江映月月敲樓。 將軍醉臥河邊骨, 又夢江南青杏羞。
    七炩閱讀 505評論 2 49

友情鏈接更多精彩內(nèi)容