This is a tutorial about on how to inserting an image in HTML by using the CSS or the Cascading Style Sheet, most web programmers are using CSS in creating their websites. To begin with follow the steps that I provide for you below.
1. Make a directory/folder name myfirstcss.
2. Look for an image which you were going to use for this activity.
3. After creating the directory and looking for image. Open your text editor and create a file titled first_activity.html.
4. Next, create another file name style.css. This is were we are going to put all our css later.
5. You may now start. just try to follow the code given below.
HTML:
<html>
<head>
<title>your title goes heretitle>
head>
<link rel="text/css" type="stylesheet" href="style.css" />
<body>
<div id="image">div>
body>
html>
#image
{
position:absolute;
width:600px;
height:100px;
background-image:url('john.gif');
background-repeat:no-repeat;
}
Sample Output:
If there is some questions about this article just CLICK THIS LINK to be redirected to the forum page.
3 Responses to “How to Insert Image in HTML using CSS”
doesnt work :\
try typing single quotation marks (') around the phrase john.gif (inside the brackets).
Seems to me the div wasn't closed
Post a Comment