㈠ 關於html中圖片的相對路徑
個人覺得把代碼貼上來會比大家在這猜的強~
Ps:一般的話都是在站點文件夾下新建"images"文件夾用來存圖片,然後代碼就是
<img src="images/xx.jpg" />
㈡ html中圖片路徑和格式問題
首先,圖片不建議你放桌面,因為桌面的物理地址很長,容易出錯;
其次,假如你的圖片在D盤的images文件下,文件名稱為 tupian.jpeg的話用下面的格式。
<img src="file:///D|/images/tupian.jpeg"/>
這個是物理路徑,如果是網站的話,用相對路徑則為下面的:
<img src="images/tupian.jpeg"/>
這個為html文件和images同一目錄的寫法
<img src="tupian.jpeg"/>
這個為圖片和html文件同一目錄的寫法
<img src="../images/tupian.jpeg"/>
這種為html所在文件夾和images文件夾處同一目錄也是網站的主目錄下的寫法
第三,你的圖片後綴為jpeg的話,代碼里也必須寫jpeg不能省略為jpg
㈢ html中插入圖片的路徑怎麼找舉個例子
html網頁圖片的路徑,可以滑鼠右鍵點擊圖片,然後點擊"檢查"或者"審查元素",在控制台找到,下面詳細介紹操作方法
1、以這個頁面為例網路圖片,對一個圖片右鍵,然後檢查元素
㈣ HTML中如何連接本地圖片
需要准備的材料分別有:電腦、瀏覽器、html編輯器。
1、首先,打開html編輯器,新建html文件,例如:index.html。
㈤ 利用HTml中的file控制項後,如何將圖片保存在指定文件夾下
//上傳文件
protected void bt_Post_Click(object sender, EventArgs e)
{
string strBaseLocation = Server.MapPath("../EmployeeFile/");
string TruePath = string.Empty;
string Temp1 = string.Empty;
string remarkid = string.Empty;
if (uploadFile.PostedFile.ContentLength != 0)
{
//獲得文件全名
string fileName = System.IO.Path.GetFileName(uploadFile.PostedFile.FileName);
//獲得擴展名
string rightName = System.IO.Path.GetExtension(fileName);
Random g = new Random();
string rad = g.Next(10000).ToString();
Temp1 = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + rad;
uploadFile.PostedFile.SaveAs(strBaseLocation + Temp1 + rightName);
TruePath = Temp1 + rightName; //獲得隨即文件名
if (Request.QueryString["id"] != "0")
{
string sql_sel = "select * from tsmannouncementmanage where id='" + Request.QueryString["id"] + "'";
OleDbDataReader dr = list.GetList(sql_sel);
if (dr.Read())
{
remarkid = dr["ContactFile"].ToString();
}
if (remarkid != "")
{
string sql_update_file = "update tsmmainannouncefile set name='" + fileName + "',newname='" + TruePath + "' where keyfile='" + remarkid + "'";
list.ExeSql(sql_update_file);
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改成功!');</script>");
}
else
{
string sql_updateorder = "update tsmannouncementmanage set fileid='" + list.GetFormatStr(Number.Text) + "' where id='" + Request.QueryString["id"] + "'";
list.ExeSql(sql_updateorder);
string sql_insert_file = "insert into tsmmainannouncefile (Name,NewName,KeyFile) values ('" + fileName + "','" + TruePath + "','" + list.GetFormatStr(Number.Text) + "')";
list.ExeSql(sql_insert_file);
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('上傳成功!');</script>");
}
}
else
{
string sql_insert_file = "insert into tsmmainannouncefile (Name,NewName,KeyFile) values ('" + fileName + "','" + TruePath + "','" + list.GetFormatStr(Number.Text) + "')";
list.ExeSql(sql_insert_file);
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('上傳成功!');</script>");
}
}
else
{
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('你還沒有選擇要上傳的附件!');</script>");
}
}
㈥ 怎麼在html中導入圖片啊圖片應該放在哪個文件夾下
你隨便放在哪,然後隨便點出一個聊天對話框,點擊表情,看到右下角有個叫表情管理,有木有!?!點擊它!看見左上角有個添加!有木有?!!點擊瀏覽,找到你隨便放的那個文件夾,點擊確定!可以支持多選,有木有!有木有!!!
㈦ 在HTML文檔如何放圖片進去
需要准備的材料分別有:電腦、瀏覽器、html編輯器。
1、首先,打開html編輯器,新建html文件,例如:index.html。