<form id="hz9zz"></form>
  • <form id="hz9zz"></form>

      <nobr id="hz9zz"></nobr>

      <form id="hz9zz"></form>

    1. 明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

      html規定元素的行內樣式(inline style)的屬性style

      [摘要]實例在 HTML 文檔中使用 style 屬性:<h1 style="color:blue; text-align:center">This is a header</h1><p style="color:red">Thi...

      實例

      在 HTML 文檔中使用 style 屬性:

      <h1 style="color:blue; text-align:center">This is a header</h1>
      <p style="color:red">This is a paragraph.</p>

      定義和用法

      style 屬性規定元素的行內樣式(inline style)

      style 屬性將覆蓋任何全局的樣式設定,例如在 <style> 標簽或在外部樣式表中規定的樣式。

      支持

      W3C: "W3C" 列指示 W3C 的 HTML/XHTML 推薦標準中是否定義了該屬性。

      IEFirefoxOperaSafariW3C
      YESYESYESYESYES

      語法

      <element style="value">

      屬性

      描述
      style_definition一個或多個由分號分隔的 CSS 屬性和值。

      以下是幾個style屬性的實例:

      使用style屬性改變背景顏色(bgcolor作用)

      <span style="font-size: 12pt;"><html>
      <body style = "
      <h1 stye = "background-color:red>This is a Heading</h1>
      <p style = "background-color:green>This is a Paragraph</p>
      </body>
      </html></span>

      style屬性淘汰了舊的"bgcolor"屬性。

      使用style屬性設置顏色、字體和尺寸

      1 <html>
      2 <body>
      3 <h1 style = "font-family:verdana">A Heading</h1>
      4 <p style = "font-family:arial;color:red;font-size:20px;">A Paragraph</p>
      5 </body>
      6 </html>

      style屬性淘汰了舊的<font>標簽。

      style屬性設置文本對其方式

      1 <html>
      2 <body>
      3 <h1 style = "text-align:center;">A Heading</h1>
      4 <p>The heading above is aligned to the center of the page</p>
      5 </body>
      6 </html>

      style屬性淘汰了align屬性。

      以上就是html規定元素的行內樣式(inline style)的屬性style 的詳細內容,更多請關注php中文網其它相關文章!


      網站建設是一個廣義的術語,涵蓋了許多不同的技能和學科中所使用的生產和維護的網站。




      日韩精品一区二区三区高清