Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
站html頁(yè)面中包含iframe的操作
一個(gè)HTML頁(yè)面可以有一個(gè)或多個(gè)子框架,這些子框架以<iframe>來標(biāo)記
iframe是內(nèi)嵌的網(wǎng)頁(yè)元素,也可以說是內(nèi)嵌的框架
iframe標(biāo)記又叫浮動(dòng)幀標(biāo)記,可以用它將一個(gè)HTML文檔嵌入在一個(gè)HTML中顯示。它和Frame標(biāo)記的最大區(qū)別是在網(wǎng)頁(yè)中嵌入 的<Iframe></Iframe>所包含的內(nèi)容與整個(gè)頁(yè)面是一個(gè)整體,而<Frame>< /Frame>所包含的內(nèi)容是一個(gè)獨(dú)立的個(gè)體,是可以獨(dú)立顯示的。
另外,應(yīng)用Iframe還可以在同一個(gè)頁(yè)面中多次顯示同一內(nèi)容,而不必重復(fù)這段內(nèi) 容的代碼。
1.獲取子頁(yè)面
2.方法調(diào)用
3.獲取元素
<iframe src="URL"></iframe>
URL 指向隔離頁(yè)面的位置。
height 和 width 屬性用于規(guī)定 iframe 的高度和寬度。
屬性值的默認(rèn)單位是像素,但也可以用百分比來設(shè)定(比如 "80%")。
實(shí)例
<html> <body> <iframe src="/example/html/demo_iframe.html" width="200" height="200"></iframe> <p>某些老式的瀏覽器不支持內(nèi)聯(lián)框架。</p> <p>如果不支持,則 iframe 是不可見的。</p> </body> </html>
HTML基礎(chǔ)教程:Iframe的用法
frameborder 屬性規(guī)定是否顯示 iframe 周圍的邊框。
設(shè)置屬性值為 "0" 就可以移除邊框:
實(shí)例
<html> <body> <iframe src="/example/html/demo_iframe.html" frameborder="0"></iframe> <p>某些老式的瀏覽器不支持內(nèi)聯(lián)框架。</p> <p>如果不支持,則 iframe 是不可見的。</p> </body> </html>
HTML基礎(chǔ)教程:Iframe的用法
iframe 可用作鏈接的目標(biāo)(target)。
鏈接的 target 屬性必須引用 iframe 的 name 屬性:
實(shí)例
<html> <body> <iframe src="/example/html/demo_iframe.html" name="iframe_a"></iframe> <p><a target="iframe_a">baidu.com</a></p> <p><b>注釋:</b>由于鏈接的目標(biāo)匹配 iframe 的名稱,所以鏈接會(huì)在 iframe 中打開。</p> </body> </html>
HTML基礎(chǔ)教程:Iframe的用法
希望以上可以解決你們心中的一些疑惑,其中可能會(huì)有不對(duì)的地方或是需要改進(jìn)的地方,歡迎留言糾正。感覺還不錯(cuò)歡迎關(guān)注收藏轉(zhuǎn)載哦
iframe元素
創(chuàng)建包含另外一個(gè)文檔的內(nèi)聯(lián)框架(即行內(nèi)框架)。
CSS3規(guī)范,視口單位主要包括以下4個(gè):
1、vw : 1vw 等于視口寬度的1%;
2、vh : 1vh 等于視口高度的1%;
3、vmin : 選取vw和vh中最小的那個(gè);
4、vmax : 選取vw和vh中最大的那個(gè);
100%高度和寬度:
body {
margin: 0; /* Reset default margin */
}
iframe {
display: block; /* iframes are inline by default */
background: #fff;
border: none; /* Reset default border */
height: 100vh; /* Viewport-relative units */
width: 100vw;
}
HTML中嵌入iframe
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>XXXX調(diào)查表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body html{
margin:0;
padding:0;
}
#app{
margin: 0 auto;
width: 600px;
}
iframe {
display: block;
background: #FFF;
border: none;
width:100vw; /* Viewport-relative units */
height:100vh;
width:100%;
}
</style>
</head>
<body>
<div id="app">
<div>
<button type="button"><span>返回</span></button>
<button type="button" onclick="print()"><span>打印</span></button>
</div>
<h2>公司部門調(diào)查表</h2>
<iframe src="C:/Users/dd/Desktop/003.html" scrolling="no"></iframe>
</div>
</html>
被嵌入頁(yè)面:
<!doctype html>
<html lang="zh-CN">
<head>
<title>XXXX調(diào)查表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<link href="https://cdn.bootcdn.net/ajax/libs/antd/4.18.2/antd.variable.css" rel="stylesheet">
<!--
https://v1-cn.vuejs.org/guide/forms.html
-->
</head>
<body>
<div id="app">
<p><h2>公司部門調(diào)查表</h2></p>
<form v-model="form" v-on:submit.prevent="saved()" >
<fieldset>
<legend>職員信息</legend>
<ol>
<li>
<label>姓名: </label>
<input v-model="form.name" type="text" name="name" autofocus/>
</li>
<li>
<label>年齡: </label>
<input v-model="form.age" type="number" name="age" />
</li>
<li>
<label>性別:</label>
<input v-model="form.sex" type="radio" name="sex" value="未知" />未知
<input v-model="form.sex" type="radio" name="sex" value="男" />男
<input v-model="form.sex" type="radio" name="sex" value="女" />女
</li>
<li>
<label>籍貫:</label>
<select v-model="form.nativePlace">
<optgroup label="山西省">
<option>太原市</option>
</optgroup>
<optgroup label="北京">
<option>北京市</option>
</optgroup>
</select>
</li>
<li>
<label>愛好:</label>
<input v-model='form.hobbys' type="checkbox" name="hobby" value="爬山" />爬山
<input v-model='form.hobbys' type="checkbox" name="hobby" value="涉水" />涉水
<input v-model='form.hobbys' type="checkbox" name="hobby" value="下棋" />下棋
<input v-model='form.hobbys' type="checkbox" name="hobby" value="游戲" />游戲
</li>
<li>
<label>所在部門:</label>
<select v-model="form.department">
<option v-for="(item, index) in form.departments" :key="item">{{item}}</option>
</select>
</li>
<li>
<label>職位:</label>
<input v-model="form.title" type="text" name="title" />
</li>
<li>
<label>提交建議:</label>
<input v-model="form.advise" type="file" name="form.advise" />
</li>
<li>
<label>填表日期:</label>
<input v-model="form.fillDate" type="date" name="fillDate">
</li>
</ol>
</fieldset>
<fieldset>
<legend>反饋意見</legend>
<ol>
<li>
<label>你對(duì)公司目前的發(fā)展表示:</label>
<input v-model="form.development" type="radio" name="development" value="滿意" /> 滿意
<input v-model="form.development" type="radio" name="development" value="不滿意" /> 不滿意
<input v-model="form.development" type="radio" name="development" value="一般" /> 一般
</li>
<li>
<label>你對(duì)公司的任職崗位表示:</label>
<input v-model="form.jobIdentification" type="radio" name="jobIdentification" value="認(rèn)同" /> 認(rèn)同
<input v-model="form.jobIdentification" type="radio" name="jobIdentification" value="不認(rèn)同" /> 不認(rèn)同
<input v-model="form.jobIdentification" type="radio" name="jobIdentification" value="一般" /> 一般
</li>
<li>
<label>你對(duì)公司的期望: </label> <br />
<textarea v-model="form.expect" rows="4" name="neme" cols="50"></textarea>
</li>
</ol>
</fieldset>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</div>
<script>
var now=new Date();
var year=now.getFullYear();
var month=now.getMonth()+1;
var day=now.getDay();
//
var app=new Vue({
el: '#app',
data() {
return {
form: {
name:"孔子",
age: 2000,
sex: "男",
nativePlace: "北京市",
hobbys: ["爬山","下棋"],
departments: ["財(cái)務(wù)部","法務(wù)部","加盟部","商務(wù)部","技術(shù)部"],
department: "技術(shù)部",
title: "工程師",
fillDate: year + "-" + month + "-" + day,
development: "一般",
jobIdentification: "不認(rèn)同",
expect: "一切都美好~"
}
}
},
methods:{
saved(){
alert(JSON.stringify(this.form));
axios.post('http://192.168.1.116:8080/data/post',this.form,{
headers: { "token": "token123" }
}).then(res=> {
console.log("result", JSON.stringify(res.data));
})
}
}
});
</script>
</html>
VUE中嵌入:
*請(qǐng)認(rèn)真填寫需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。