首页 > 其他分享 >HTML_03_Images

HTML_03_Images

时间:2023-02-13 15:22:50浏览次数:29  
标签:03 around journeys Many species HTML Images birds distance

Images

1. Storing images on the site

create a folder to store

On a big site, subfolders such as "interface", "products", "news" are necessary

2

2. adding images

**<img>**

src usually a relative URL

alt text description will be displayed if users cannot see the images

title tooltip, display when users hovers over the images

<img src="images/quokia.jpg" alt="A family of quokka" title="The quokia is an Australian marspial that is similar in size to the domestic cat."/>

height & width

specific height and width in pixels

<img src="images/quokia.jpg" alt="A family of quokka" width="600" heigh="4500"/>

3. where to place images in the code

Code location

Before a paragraph

<img src="images/bird.gif" alt="Bird" width="100" 
 height="100" />
<p>There are around 10,000 living species of birds 
 that inhabit different ecosystems from the 
 Arctic to the Antarctic. Many species undertake 
 long distance annual migrations, and many more 
 perform shorter irregular journeys.</p>
<hr />

Inside the start of a paragraph

<p><img src="images/bird.gif" alt="Bird" width="100" 
height="100" />There are around 10,000 living 
 species of birds that inhabit different 
 ecosystems from the Arctic to the Antarctic. Many 
 species undertake long distance annual 
 migrations, and many more perform shorter 
 irregular journeys.</p>

In the middle of a paragraph

<p>There are around 10,000 living species of birds 
 that inhabit different ecosystems from the 
 Arctic to the Antarctic.<img 
src="images/bird.gif" alt="Bird" width="100" 
height="100" />Many species undertake long 
 distance annual migrations, and many more perform 
 shorter irregular journeys.</p>
3

align

left

<p><img src="images/bird.gif" alt="Bird" width="100" 
height="100" align="left" />There are around 
 10,000 living species of birds that inhabit 
 different ecosystems from the Arctic to the 
 Antarctic. Many species undertake long distance 
 annual migrations, and many more perform shorter 
 irregular journeys.</p>

right

<p><img src="images/bird.gif" alt="Bird" width="100" 
height="100" align="right" />There are around 
 10,000 living species of birds that inhabit 
 different ecosystems from the Arctic to the 
 Antarctic. Many species undertake long distance 
 annual migrations, and many more perform shorter 
 irregular journeys.</p>
4

top

<p><img src="images/bird.gif" alt="Bird" width="100" 
 height="100" align="top" />There are around 
10,000 living species of birds that inhabit 
different ecosystems from the Arctic to the 
Antarctic. Many species undertake long distance 
annual migrations, and many more perform shorter 
irregular journeys.</p>

middle

<p><img src="images/bird.gif" alt="Bird" width="100" 
 height="100" align="middle" />There are around 
10,000 living species of birds that inhabit 
different ecosystems from the Arctic to the 
Antarctic. Many species undertake long distance 
annual migrations, and many more perform shorter 
irregular journeys.</p>

right

<p><img src="images/bird.gif" alt="Bird" width="100" 
 height="100" align="bottom" />There are around 
10,000 living species of birds that inhabit 
different ecosystems from the Arctic to the 
Antarctic. Many species undertake long distance 
annual migrations, and many more perform shorter 
irregular journeys.</p>
5

4. Image resolution

screen display usually contains 72 pixels per inch

dip = dots per inch

ppi, digital

dpi, print

5. Vector images

Advantages: increase the dimensions of the image without affecting the quality of it.

Vector images are created by placing points on a grid, and drawing lines between those points. A color can then be added to "fill in" the lines that have been created.

Scalable Vector Graphics (SVG) are a relatively new format used to display vector images directly on the web (eliminating the need to create bitmap versions of them), however its use is not yet widespread.

6. transparent & PNG

If the transparent part of the image has diagonal or rounded edges or if you want a semiopaque transparency or a dropshadow, then you will need to save it as a PNG.

If the transparent part of the image has straight edges and it is 100% transparent (that is, not semi-opaque), you can save the image as a GIF (with the transparency option selected)

7. Figure and Caption

<figure>

<figcaption>

<html>
<head>
 <title>Images</title>
</head>
<body>
 <h1>
 <img src="images/logo.gif"
 alt="From A to Zucchini" />
 </h1>
 <figure>
 <img src="images/chocolate-islands.jpg" 
 alt="Chocolate Islands"
 title="Chocolate Islands Individual Cakes" />
 <p>
 <figcaption>
 This recipe for individual chocolate 
 cakes is so simple and so delectable!
 </figcaption>
 </p>
 </figure>
 <h4>More Recipes:</h4>
 <p>
 <img src="images/lemon-posset.jpg" 
 alt="Lemon Posset" 
 title="Lemon Posset Dessert" />
 <img src="images/roasted-brussel-sprouts.jpg" 
 alt="Roasted Brussel Sprouts" 
 title="Roasted Brussel Sprouts Side Dish" />
 <img src="images/zucchini-cake.jpg" 
 alt="Zucchini Cake" 
 title="Zucchini Cake No Frosting" />
 </p>
</body>
</html>

6

标签:03,around,journeys,Many,species,HTML,Images,birds,distance
From: https://www.cnblogs.com/moyutime/p/17116496.html

相关文章

  • HTML_01_TEXT
    1.TEXT<strong>bold</strong><!--bydefauly,thecontentshowedinbold--><b>bold</b><i>italics</i><em>italics</em><del>del</del><s>del</s><ins>ins......
  • Vscode报错: error:0308010C:digital envelope routines::unsupported错误记录解决
    Vscode报错:error:0308010C:digitalenveloperoutines::unsupported错误记录解决因为安装了新版本的node才报的错误:node版本:v18.14.0运行npmrunserve报错解决办法:......
  • HTML 标题
    HTML标题标题(Heading)是通过<h1>-<h6>标签进行定义的。<h1>定义最大的标题。<h6>定义最小的标题。实例<h1>这是一个标题。</h1><h2>这是一个标题。</h2><h3......
  • HTML 段落
    HTML段落段落是通过<p>标签定义的。实例<p>这是一个段落</p><p>这是另一个段落</p>注意:浏览器会自动地在段落的前后添加空行。(</p>是块级元素)不要忘记结束......
  • HTML 文本格式化
    HTML文本格式化加粗文本斜体文本电脑自动输出这是 下标 和 上标HTML格式化标签HTML使用标签<b>("bold")与<i>("italic")对输出的文本进行格式,如:粗体 or ......
  • 2023-02-13 More than one file was found with OS independent path 'lib/armeabi-v7
    as工具运行rn项目报错:MorethanonefilewasfoundwithOSindependentpath'lib/armeabi-v7a/libfbjni.so'.IfyouareusingjniLibsandCMakeIMPORTEDtargets。......
  • HTML 属性
     属性是HTML元素提供的附加信息。HTML属性HTML元素可以设置属性属性可以在元素中添加附加信息属性一般描述于开始标签属性总是以名称/值对的形式出现,比如:nam......
  • #0033. Educational Codeforces Round 3
    609A贪心优先选大的USBflashdrive609B先处理每个genre的书有多少本,然后直接枚举每次购买的是哪两种genre然后乘法原理即刻609C手下考虑balanced的长啥样。假设这n......
  • #0032. Educational Codeforces Round 2
    600A简单题但有个坑点在于会有空字符串600B一道可以用来实验upper_bound的题600C挺有趣的一道题。首先考虑怎样的字符串可以通过permutation变成palindrome:条件是至......
  • HTML学习笔记1
    1.2单标记和双标记1.单标记:空标记,就是没有结束标记的称之为单标记。语法:水平线标记:​​​<hr/>​​​换行标记:​​<br/>​​​2.双标记:体标,就是这个标记有开始和结......