我的代码是否正确显示图片时遇到问题

问题描述 投票:0回答:0

在显示管理员图片时遇到困难,而且我的代码是否正确也面临图书海报的问题。提供我遇到问题的项目代码的链接

管理员照片未显示:

.maincontainer{
    width: 100%;
    height: 100vh;
    
}
.navbox{
    width: 100%;
    height: 8vh;
    background: #af4154;
    display: flex;
}
<div class="maincontainer">
    
    <div class="navbox">
        <div style="width: 40px; padding: 10px; align-self: center;"><img src="https://icon-library.com/images/book-icon-transparent/book-icon-transparent-11.jpg" style="width:50px;"></div>
        <div style="color: white; align-self: center; font-size: 16px; font-family: Open Sans; padding: 10px; letter-spacing: 1px;">Ultimate Shopee</div>

        <div style="width: 67%; display: flex; align-items: center; justify-content: center;">
            <a href="/books/bookinterface" target="mw" style="text-decoration: none; color: white; align-self: center; font-size: 14px; font-family: Open Sans; font-weight: 600; letter-spacing: 1px; margin: 5%; ">Add Books</a>
            <a href="/books/fetch_all_books" target="mw" style="text-decoration: none; color: white; align-self: center; font-size: 14px; font-weight: 600; font-family: Open Sans; letter-spacing: 1px; margin: 5%; ">Book List</a>
            
        </div>

        <div style="display: flex; align-items: center;">
            <a href="/admin/loginpage" style="text-decoration: none; color: white; align-self: right; font-size: 14px; font-family: Open Sans; font-weight: 600; letter-spacing: 1px; margin: 5%; ">Logout</a>
        </div>

        <div style="width: 8%; display: flex; justify-content: center; align-self: center; color: white; font-size: 14px; font-weight: 600; font-family: Open Sans;" >
            <%= admin.adminname %>       
        </div>

        <div>
            <img src="/images/<%= admin.picture %>" style="width: 30px; border-radius: 15px;"/>
        </div>
    </div>

    <div>
        <iframe width="100%" height="91%" frameborder="0" name="mw"></iframe>
    </div>

</div>

海报未显示:

<html>
    <center>
        <form action="/books/edit_poster" method="post" enctype="multipart/form-data">
          <input type="hidden" name="bookid" value="<%=data.bookid %>">
          <h1><%=data.bookname%></h1><br><br>
          <img src="/images/<%=data.poster %>" width="350"/><br><br>
          <b>Upload New Poster</b><br><br>
          <input type="file" required name="poster">
          <input type="submit" value="Upload Image">

          
        </form>
    </center>
</html>

在导航框中显示的管理员照片:

Admin photo to show within the nav box

点击书的海报书海报不显示:

On clicking the poster of the book book poster is not showing up

这是我的整个项目代码链接

ejs
© www.soinside.com 2019 - 2024. All rights reserved.