Reputation: 99
Image not getting aligned and near image label should come but its not working correctly
<style>
label{
color:red;
font-family: "Times New Roman";
font-size: 25px;
}
label.desc{
color:blue;
font-family: "Times New Roman";
font-size: 12px;
position: relative;
left: -20px;
}
img{
float:left;
width:300;
height:300;
}
</style>
Upvotes: 0
Views: 93
Reputation: 13743
Put every image and corresponding labels in a div like this:
<div id="a">
<image src="http://upload.wikimedia.org/wikipedia/commons/3/38/Heart.gif"/>
<label>1<label>
<label>2<label>
<label>3<label>
</div>
and give that div width:
#a{
width: 260px;
}
Upvotes: 1
Reputation: 2330
make sure the file extension is .css and not .txt
You may be hiding your file extensions. Check http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-7
Then put this:
<link href="style.css" rel="stylesheet" type="text/css" />
between the
<head></head>
tags in your HTML file to call your stylesheet.
Make sure to rename "style.css" with whatever you name your new stylesheet.
Upvotes: 0