简体   繁体   中英

How to link image into html using the intellij idea IDE?

I have got a simple html page on intellij idea that uses a java class to display the webpage on the localhost:9002/.

I am using the bootstrap library and my images are not been parsed on my webpage properly.

I am looking for someone to specify the correct directory of images within intellij and if any changes should be made to the standard image link in my html.

My image link is as follows:

<a class="navbar-brand" href="ShoppingPortal.html"><img src="logo.png" alt="Company logo" style="width:225px;height:35px; padding-bottom: 2px;"></a>

Any ideas???

Thanks

If the image is in the same directory as your .html file then adding a forward slash -> src="/logo.png" should work.

If you are going to have more than one image it might be worth while adding an images directory to your root and then updating the src src="/images/logo.png"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM