Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Image won't work

Liam Ferguson

Active Coder
here is code:
HTML:
!DOCTYPE html>
<html>
<head>
    
    <title>HTML in sublime text 3</title>

    <style>
body {
  background-color: black;
  text-align: center;
  color: white;
}
</style>

</head>
<body style='background-color:black;'>

    <span style='font-family: fantasy'><h1><center>How to code with HTML in sublime text 3</center></h1></span>
    <span style='font-family: arial'><h2><center>By liam Ferguson</center></h2></span>
</body>
<p>_________________________________________________________________________________
    
</p>
<p>
    <span style='font-family: cursive'><P>Sublime Text 3 is a coding program that allows you to edit programs, crete programs and edit text</P></span>
</p>
<img src="screenshot(30).png" alt="A shot of code" width="100" height="100"/>

</html>
 
here is my code
HTML:
<!DOCTYPE html>
<html>
<head>
    
    <title>HTML in sublime text 3</title>

    <style>
body {
  background-color: black;
  text-align: center;
  color: white;
}
</style>

</head>
<body style='background-color:black;'>

    <span style='font-family: fantasy'><h1><center>How to code with HTML in sublime text 3</center></h1></span>
    <span style='font-family: arial'><h2><center>By liam Ferguson</center></h2></span>
    
</body>
<p>_________________________________________________________________________________
    
</p>
<p>
    <span style='font-family: cursive'><P>Sublime Text 3 is a coding program that allows you to edit programs, crete programs and edit text</P></span>
</p>
<body>
    <img src="screenshot(30).png" alt="A shot of code" width="100" height="100"/>
</body>

</html>
 
Hi there,

I reviewed your code, and have determined that it is most likely the file path of your image. To test this theory, lets create a new folder called images. Then move the image into that folder and then edit the image back to show images/screenshot(30).png.
 
i have this:
HTML:
<!DOCTYPE html>
<html>
<head>
    
    <title>HTML in sublime text 3</title>

    <style>
body {
  background-color: black;
  text-align: center;
  color: white;
}
</style>

</head>
<body style='background-color:black;'>

    <span style='font-family: fantasy'><h1><center>How to code with HTML in sublime text 3</center></h1></span>
    <span style='font-family: arial'><h2><center>By liam Ferguson</center></h2></span>
    
</body>
<p>_________________________________________________________________________________
    
</p>
<p>
    <span style='font-family: cursive'><P>Sublime Text 3 is a coding program that allows you to edit programs, crete programs and edit text</P></span>
</p>
<body>
    <img src="images/screenshot(30).png" alt="A shot of code" width="100" height="100"/>
</body>

</html>
 
i have this:
HTML:
<!DOCTYPE html>
<html>
<head>
   
    <title>HTML in sublime text 3</title>

    <style>
body {
  background-color: black;
  text-align: center;
  color: white;
}
</style>

</head>
<body style='background-color:black;'>

    <span style='font-family: fantasy'><h1><center>How to code with HTML in sublime text 3</center></h1></span>
    <span style='font-family: arial'><h2><center>By liam Ferguson</center></h2></span>
   
</body>
<p>_________________________________________________________________________________
   
</p>
<p>
    <span style='font-family: cursive'><P>Sublime Text 3 is a coding program that allows you to edit programs, crete programs and edit text</P></span>
</p>
<body>
    <img src="images/screenshot(30).png" alt="A shot of code" width="100" height="100"/>
</body>

</html>
You should only have one <body> tag. I noticed you have two body tags.
 
Can you please send us the exact filename and the path ?
For example, it might be something like /home/username/public_html/images/screenshot (30).png
The only way your image wouldn't work is if the image doesn't exist or if you have some sort of CSS or JS that is hiding the image or breaking the src.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom