HTML完结篇)制作一个简单页面(详解)——零基本自学网页制作
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">页面制作技术详解</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">1.页面内容居中<span style="color: black;">表示</span><span style="color: black;">办法</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">将这段代码<div style="width:50%;margin:auto;"><span style="color: black;">安置</span>在<body>标签之下。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">将</div><span style="color: black;">安置</span>在</body>之上。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">将<span style="color: black;">所有</span>内容包裹在这个div中,就<span style="color: black;">能够</span>实现<span style="color: black;">全部</span>页面居中。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">内容<span style="color: black;">表示</span>宽度为浏览器视窗宽度的50%。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">margin(外边距)是在CSS布局中经常用到的属性,它指定了该div元素距离四周的距离。<span style="color: black;">运用</span>“auto”值,<span style="color: black;">能够</span>实现居中。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2.导航栏悬停顶端<span style="color: black;">办法</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">把四个a标签装到一个div中。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">将<div style="position:fixed; top:0px;">添加到<a style="margin: 0px 30px 0px 10px;" href="#chapter1">试飞进程</a>之上。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">将</div>添加到<a style="margin: 0px 30px 0px 0px;"href="#chapter4">总体<span style="color: black;">评估</span></a>之下。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">position是css布局中指定位置的属性,“fixed”值是让该div悬停于固定位置。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">默认下,该div距离视窗顶端有10px<span style="color: black;">上下</span>的距离,<span style="color: black;">因此呢</span>为了让它与视窗顶部对齐,添加top:0px。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">3.鼠标滑过导航标题或链接时改变背景色提示</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这就要介绍关于css的写法了。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">简单<span style="color: black;">来讲</span>,<span style="color: black;">便是</span>在<head></head>标签中添加</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><style></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">a:hover</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">{</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">bac<span style="color: black;">公斤</span>round-color:#ffff00;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">}</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"></style></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">学过HTML页面中head标签有啥用?——零<span style="color: black;">基本</span>自学网页制作的小伙伴应该<span style="color: black;">晓得</span>,CSS脚本是<span style="color: black;">能够</span>添加在head元素中的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">其中,a:hover中的a指的是所有<a></a>标签。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">hover指的是:当鼠标悬停在a上面时的状态。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">运用</span>:连接。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这个状态下要执行的内容在{}中。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">bac<span style="color: black;">公斤</span>round-color:#ffff00;即背景色为黄色。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">4.<span style="color: black;">隐匿</span>滚动条<span style="color: black;">办法</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">首要</span>,<span style="color: black;">咱们</span>要<span style="color: black;">知道</span>一点,<span style="color: black;">便是</span>,滚动条是在内容长度超过视窗高度时产生的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>要取消视窗最右侧滚动条,就要<span style="color: black;">掌控</span>内容高度。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">把</p>和<span style="color: black;">所有</span>装进中,<span style="color: black;">掌控</span>该div的高度<span style="color: black;">能够</span>实现。
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在<p>标签色上面添加<div>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在</map>标签下面添加</div>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下面,为div规定尺寸,添加style="width:610px; height:530px;"。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这般</span>,就不会超出视窗。<span style="color: black;">然则</span>代码写完后<span style="color: black;">发掘</span>并不是,如图:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic4.zhimg.com/80/v2-c88edb1a0b15924eabe691cc69fb1cb3_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">多出的文字内容超出div范围,右侧滚动条依然存在。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这就要在div的style中再<span style="color: black;">增多</span>一条语句"overflow-y:scroll;"</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这句话的意思是“overflow-y”(超出最大高度)就<span style="color: black;">表示</span>滚动条(scroll)。而不是让内容超出div的边框。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><div style="width:610px; height:530px; overflow-y:scroll;" ></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">如图:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic3.zhimg.com/80/v2-6cc044266ef80e07bb2fc9af4cc25532_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">由于</span><span style="color: black;">照片</span>宽度的问题,下方的x轴的scroll<span style="color: black;">亦</span><span style="color: black;">显现</span>了,<span style="color: black;">咱们</span>不想看到它,影响美观。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">添加“overflow-x:hidden”<span style="color: black;">就可</span>,hidden(<span style="color: black;">隐匿</span>)。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><div style="width:610px; height:530px; overflow-y:scroll; overflow-x:hidden;" ></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">如图:hidden之后,将<span style="color: black;">没</span>法滚动或拖动画面。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">最后,<span style="color: black;">咱们</span>要把右侧的scroll<span style="color: black;">亦</span><span style="color: black;">隐匿</span>掉,<span style="color: black;">由于</span>点击鼠标,滚动滚轮就够了,滚动条实在碍眼。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">从前面的例子可知,hidden是不行的,有<span style="color: black;">无</span>别的办法?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">那<span style="color: black;">便是</span>在盖div的<span style="color: black;">外边</span>再添加一个div,让这个div的宽度略<span style="color: black;">少于</span>里面div的宽度,小到<span style="color: black;">刚才</span>挡住滚动条既<span style="color: black;">能够</span>。如图:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这个div<span style="color: black;">这般</span>写<span style="color: black;">就可</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><div style="margin:30px 0px 0px 0px;width:600px;overflow:hidden;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"></div></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">同期</span>还要给里面的div添加margin来让它们对齐</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><div style="margin:30px 0px 0px 0px;width:600px;overflow:hidden;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><div style="margin:0px 0px 0px 8px;width:610px; height:530px; overflow-y:scroll;overflow-x:hidden;" ></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><!--省略了p img map 请<span style="color: black;">自动</span>脑补或参考源码--></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"></div></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"></div></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">完整代码:用HTML制作一个简单页面(代码阅读练习)——零<span style="color: black;">基本</span>自学网页制作</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">4.<span style="color: black;">照片</span>区域链接</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">详见</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HTML中的<span style="color: black;">照片</span>区域链接<span style="color: black;">办法</span>详解——零<span style="color: black;">基本</span>自学网页制作</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HTML<span style="color: black;">照片</span>区域链接<span style="color: black;">重视</span>事项与Gimp基本用法——零<span style="color: black;">基本</span>自学网页制作</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">详细</span>过程请参照演示视频:</p>
外贸网站建设方法 http://www.fok120.com/ “板凳”(第三个回帖的人) 你的见解独到,让我受益匪浅,非常感谢。 我完全同意你的看法,期待我们能深入探讨这个问题。
页:
[1]