VampireFreaks
[ Vampirefreaks.com ]



VFLayouts.com - Vampirefreakss Official Layout Site

Displaying Images, Image Codes, Image Links, Vampirefreaks Pics



Pick a Section




Basic Images


To simply put an image on your page or in a comment, the HTML code is:

<img src="http://www.YOUR IMAGE URL HERE.gif">

Images must be UPLOADED to somewhere like [ Tinypic ] for this to work. You cannot use an image that is just saved on your computer. When you upload your image, the host (eg Tinypic) will give you an address for it (Sometimes called an URL or LINK), and you will need to insert this into the above code. If the host gives you more than one address, and you're unsure which is the right one, look for one that begins with "http://" and ends with an image file extension, (usually ".gif", ".jpg", or ".png").

If you want more help with image hosting, or a list of other free image hosts [ Click Here ].




Image Links


This is the code to make your own clickable image.
You must use the full path of the page you want to link to (ie including the http:// bit), or it won't work.

<a href="http://www.PAGE TO LINK TO.com"><img src="http://www.YOUR IMAGE URL HERE.gif"></a>


Open In a New Window

If you want your link to open in a new window when someone clicks on it, just include target="_blank" in the link tag (the "a href" part), like this:

<a href="http://www.PAGE TO LINK TO.com" target="_blank"><img src="http://www.YOUR IMAGE URL HERE.gif"></a>


No Borders?

Image links usually have a border by default. If you dont want a border on your image, add border="0" to the image tag like this:

<a href="http://www.PAGE TO LINK TO.com"><img src="http://www.YOUR IMAGE URL HERE.gif" border="0"></a>




Resizing (with HTML)


It's better to resize your images in a program like Photoshop or Paintshop before you upload them if you can, as resizing with code reduces image quality.

If you want to resize an image that VF has put on your page, like your default picture or (on some templates) thumbnails or friend pics, you need the [ Resizing VF Pics ] bit. This section is for occasions where you have added the image tag yourself, and can edit it. To change the size of your image, just include your desired width and height in the image tag, eg:

<img src="http://www.PATH_TO_YOUR_IMAGE.gif" width="100px" height="150px">




Alternative Text (Alt)


Alts let you include some alternative text for if the image doesn't load. If your visitors are using Internet Explorer the text pops up on mouseover too. Alt tags are used to give the visitor some information about your image, and its good practice to include them if you can.

Move your mouse of the image on the left (Explorer users only) to see the alternative text pop up. The image on the right is what would show up if the image failed to load.
VF Logo. Prepare to be Assimilated! VF Logo. Prepare to be Assimilated!

<img src="http://www.YOUR IMAGE URL.gif" alt="Your Alternative Text">




VF Pic Classes (defaultpic, thumbnail & commenticon)


You can use CSS to edit the way your VF pictures display on your profile. To use CSS to edit something you first have to be able to identify the thing you want to edit. Luckily most of the things on your VF page already have their own IDs known as classes. The picture you have set to default always has the class "defaultpic" and the others all have the class "thumbnail". This means that if you make any changes to thumbnail, all of your smaller pictures will be affected.

profile pics


Classes in CSS always start with a dot, so in the code below the default picture is referred to as ".defaultpic", and thumbs are ".thumbnail".

There may be one more image class on your profile page- if you allow other peoples comments to show up on your profile they have a small icon beside their message. These have the class ".commenticon". Like with the thumbnails, any changes you make to .commenticon will affect all the user icons on your page.




Hiding VF Pics


The code to make VF pics disappear off your page is very simple. As you can see there's a line of CSS for defaultpic, one for thumbs and one for commenticons [ which is which? ]. If you don't want to make them all vanish, then just take out the line/s for the ones you want to keep.

<style type="text/css">
.defaultpic { display: none; }
.thumbnail { display: none; }
.commenticon { display: none; }
</style>


Nb. There is an option on the edit profile page for controlling how many thumbnails show on your profile.

number of thumbs to display




Borders on VF Pics


If you want to create borders that change on hover, check out the [ Mouseover Images ] bit. This code will put a static border around each type of VF pic [ which is which? ]. As with the code above, I've kept the 3 types of images separate so that you can easily remove the lines for the one/s you don't want to change.

<style type="text/css">
.defaultpic { border: 2px solid red; }
.thumbnail { border: 3px dashed lime; }
.commenticon { border: 3px inset teal; }
</style>

[ Click Here ] to go to the borders page and find out what other different types are available.




Resizing VF Pics


You can use CSS to set the pics VF puts on your page to any dimensions you like. As with the codes above, I'm going to include an example code for each different type of pic [ which is which? ]. You can erase the line/s for any images you don't want to change:

<style type="text/css">
.defaultpic { width: 300px; height: 200px; }
.thumbnail { width: 50px; height: 50px; }
.commenticon { width: 150px; height: 150px; }
</style>

Remember sizes applied to thumbnails or commenticons will affect all of them. Size is measured in px (pixels). 1px is a tiny dot about the size of a full stop.

This is a 50px image This is a 100px image This is a 200px image
50px by 50px image 100px by 100px image 200px by 200px image




Positioning VF Pics


When shoving VF pics around your page you should be aware that some methods of positioning have different results in different browsers, or at different screen resolutions. Absolute or relative positioning is likely to be an absolute disaster unless you know exactly what you're doing, and even then it's fiddly. Also bear in mind that any positioning you apply to your thumbnails affects them all in exactly the same way.

The thing I get asked most often is how to make the thumbnails appear beside the main pic, like this:

defaultpic on the left


It's dead easy. All you have to do is float the defaultpic to the left (or right) and things below it will move up beside it if there is room. To get the effect above the code is:

<style type="text/css">
.defaultpic { float: left; }
.userinfo { clear: both; }
</style>

Alternatively you can reverse the effect like this:

defaultpic on the right


By using this code:

<style type="text/css">
.defaultpic { float: right; }
.userinfo { clear: both; }
</style>

The .userinfo { clear: both; } part of this code is to make sure the userinfo table starts on a new line in all browsers, and doesn't end up trying to squeeze up beside the defaultpic too.


Positioning with Margins:

Margins are simply the space around your pictures. They're good for making small adjustments to their positions, like spacing thumbnails further apart, or creating a bit more room around the defaultpic. CSS allows you to adjust margin-top, margin-bottom, margin-left or margin-right individually, or you can just use margin alone if you want all sides to have the same size margin.

If you're giving your defaultpic a margin, its just as simple as doing something like:

<style type="text/css">
.defaultpic { margin-right: 100px; }
</style>


Similarly, with commenticons, although the margins you set will affect each one, this is most likely what you want to happen anyway, so its not really a concern:

<style type="text/css">
.commenticon { margin: 50px; }
</style>


However, when it comes to thumbnails, they're right next to each other, and you will notice that a 50px margin on ".thumbnail" will create a 100px space between them. Why? Because margins don't overlap. Instead you get the sum of the 2 margins that are next to each other-

picture margins


So we compensate by halving the size of the margin we set, or by only setting one margin that affects horizontal spacing, and one that affects vertical, (eg just left, not left and right). To get a 50px space between all our thumbs (both horizontally and vertically) we could use either:

<style type="text/css">
.thumbnail { margin: 25px; }
</style>

(sets a 25px margin all the way around every thumbnail) Or:

<style type="text/css">
.thumbnail { margin-right: 50px; margin-bottom: 50px; }
</style>

(sets a 50px margin on the right, and bottom of each thumb, but nothing on the left or top).




Mouseover Images


Aka how to make your images change when someone moves their mouse over them:



To do this, first you need two images [ uploaded ] that are exactly the same size. (Nb, if you just want to add a [ filter ] like wave or invert to some of your VF pics, skip this and scroll down a bit).
Once you have your images, the code you need is:

<style type="text/css">
.hoverdiv { width: 100px; height: 100px; border: 1px solid red; }
a:link .hoverdiv, a:visited .hoverdiv { background: url('http://PATH TO IMAGE 1'); }
a:hover .hoverdiv { background: url('http://PATH TO IMAGE 2'); }
</style>

<a href="#"><div class="hoverdiv"></div></a>

Once you've got it working you'll probably want to remove the border: 1px solid red; part. I just included it so that you can see where the div box is even if the images fail to appear. You will also need to change the width and height to match the width and height of the images you want to use, and the background urls to the paths of those images (image 1 is the original image, image 2 is the one that shows on mouseover).


VF Pics - Filters on Mouseover.

Although you can't swap your VF pics for different ones on mouseover, you can add a [ filter ] (shows up in IE only) or [ Opacity ] on mouseover. Go to those sections for how to apply the different filters. I'm going to use opacity as an example, because it works in most browsers.



The code for this one is easier. To apply it to defaultpic use:

<style type="text/css">
a:link .defaultpic, a:visited .defaultpic { filter: alpha(opacity=30); -moz-opacity:.30; opacity:.30; }
a:hover .defaultpic { filter: alpha(opacity=80); -moz-opacity:.80; opacity:.80; }
</style>


For thumbnails (affects all of them):

<style type="text/css">
a:link .thumbnail, a:visited .thumbnail { filter: alpha(opacity=30); -moz-opacity:.30; opacity:.30; }
a:hover .thumbnail { filter: alpha(opacity=80); -moz-opacity:.80; opacity:.80; }
</style>


Or, if you just one one type of hover filter, that affects every image on the page:

<style type="text/css">
a:link img, a:visited img { filter: alpha(opacity=30); -moz-opacity:.30; opacity:.30; }
a:hover img { filter: alpha(opacity=80); -moz-opacity:.80; opacity:.80; }
</style>


You can do other things on mouseover too. How about making an image grow huge:

grow filter demo


<style type="text/css">
a:link .defaultpic, a:visited .defaultpic { width: 100px; height: 100px; }
a:hover .defaultpic { width: 200px; height: 200px; }
</style>


Or changing the border:

border filter demo


<style type="text/css">
a:link .defaultpic, a:visited .defaultpic { border: 3px double red; }
a:hover .defaultpic { border: 5px solid lime; }
</style>




Opacity / Transparency


This code works in (at least) IE, Firefox and newer versions of Opera. It may work in other browsers too. If you want fade in or out effects IE has a specific filter for that: [ Fade Filter ], but it wont work in any browsers other than Internet Explorer. Of course you can always replace the alpha(opacity=xx) part of this code with a fade in/ out filter for explorer, and set moz-opacity as well for other browsers. Opacity (in case your wondering) is simply the opposite to transparency. 100% Opaque is completely visible, while 100% transparent is completely invisible. Anyhow, on with the filter.

20% opaque image 50% opaque image 70% opaque image
20% Opaque Image 50% Opaque Image 70% Opaque Image

You can apply opacity to any image on your page, whether its a VF picture, or one you wrote the HTML for yourself. In the [ Filters ] section below, is a list of all the different types of image you can apply filters to. (just swap "filter: fliph;" for "filter: alpha(opacity=50); -moz-opacity:.50; opacity:.50;" ).

Heres an example of 70% opacity applied to defaultpic.

<style type="text/css">
.defaultpic { filter: alpha(opacity=70); -moz-opacity:.70; opacity:.70; }
</style>

Nb. Opacity works on text too. [ Text Opacity ]



Filters (IE only)


You can use filters on images, animated images and even text. (See the [ text bit ] for an explantion of applying filters to text). Filters are exclusive to the Internet Explorer browser, so people using other browsers will just see the original image.

You can apply image filters to any or all of your VF pics, and any pics you've added with your own HTML. We use CSS to set which images the filter will affect:

  • To apply a filter to your default (main) picture, the code is:
    <style type="text/css"> .defaultpic { filter: fliph; } </style>

  • For thumbnails (all of them):
    <style type="text/css"> .thumbnail { filter: fliph; } </style>

  • For comment icons (the little avatars beside peoples messages):
    <style type="text/css"> .commenticon { filter: fliph; } </style>

  • For all images that arent links (none clickable images):
    <style type="text/css"> img { filter: fliph; } </style>

  • For all link (clickable) images *OVERRIDES FILTERS ON .DEFAULTPIC, .THUMBNAIL & .COMMENTICON:
    <style type="text/css"> a:link img, a:visited img { filter: fliph; } </style>

  • For link (clickable) images on hover (when mouse is hovered over them):
    <style type="text/css"> a:hover img { filter: fliph; } </style>

  • To add a filter to an image you have included with your own HTML:
    <img src="Your Image Url" style="filter: fliph;">

For the examples above, Ive used the fliph (horizontal flip) filter, but of course there are lots more. To use any of the filters below in place of the horizontal flip filter, just swap filter: filph; for the filter you want to use.



o Fade Filters (IE Only)



filter: alpha(opacity=0, finishopacity=100, style=1);
original image fade filter



filter: alpha(opacity=100, finishopacity=0, style=1);
original image fade filter



filter: alpha(opacity=100, finishopacity=0, style=2);
original image fade filter



o Xray Filter (IE Only)



filter: xray;
original image xray



o Blur Filter (IE Only)



filter: blur;
original image blur



o Horizontal Flip Filter (IE Only)



filter: fliph;
original image fliph



o Vertical Flip Filter (IE Only)



filter: flipv;
original image flipv



o Gray Filter (IE Only)



filter: gray;
original image gray



o Invert Filter (IE Only)



filter: invert;
original image invert



o Wave Filter (IE Only)



filter: wave;
original image wave




Uploading Help / Hosts


Uploading an image means that you put it on the internet so anyone can access it at any time, even if your computer is turned off. There are lots of ad supported sites that will let you host your images for free.


o Tinypic   [ www.tinypic.com ]

Tinypic is possibly the simplest image host ever. You simply click "Browse" find the file on your computer you want to upload, and press "Upload":

Tinypic


When you're done, it spits out 4 links like this:

Tinypic


You want the bottom one. The "Direct Link For Layouts". Then all you do to put the image on your page copy the link and paste it into an image tag, like this:

<img src="http://i9.tinypic.com/6u98iea.jpg">

Although tinypic is good for hosting the odd image, it has its drawbacks- if you loose an url you cant get it back and you have to start over, and you cant delete your images.




o Photobucket   [ photobucket.com ]

Photobucket is a little more complicated, requiring you to sign up and log in before you can start to upload your pictures. (Press the red "Join Now" button on the top right of the page to create an account). On the plus side, it does have the benefit of allowing you to edit delete and organize your images, and upload several at once.
When you've signed up and logged in you get an interface similar to tinypic- browse and upload buttons. Once the image has uploaded you're returned to the same page, except with an orange box telling you your images were uploaded successfully. Then you have to scroll down to get the url. Each one has 4 links (again like Tinypic), and again you want the "Direct Link", this time it's the second one down.

Photobucket


<img src="http://i72.photobucket.com/albums/i170/ElectroGenius/monkey.gif">




o Imageshack   [ www.imageshack.us ]

Imageshack is a bit over complicated looking, but again theres only 2 buttons you need to pay attention to- "Browse" and "Host It". At first glance it looks like an email address is required, but as with Tinypic you don't actually need to create an account to upload, so if you don't want to just leave the email field blank.

Imageshack


When you've uploaded your picture you're faced with a whole bunch of urls most of which are in BBCode, and this time none of them are a direct link. What you do have however is a thumbnail code, which is ideal if your image is large and you want people to see a small version then click for full. If you're happy with that all you need to do is take the top code, the "Thumbnail For Websites" and paste it into your page exactly as it is:

Imageshack


If this isn't what you're after and you want to display the full image, what you need to do instead of selecting a link from that page, is click ON the image:

Imageshack


Which will take you to a new page with the big version of your image on. Then scroll down, and you'll see another box of links like this:

Imageshack


And there right at the bottom is your direct link. As with the hosts above you can just take this direct link and paste it into your image tag, like so:

<img src="http://img413.imageshack.us/img413/3908/monkeyuo7.gif">

Then paste the image tag into your page.




o Index Junkie   [ http://indexjunkie.com ]

Index Junkie is another nice simple one. Just browse for the file, then press "Start Uploading".

Index Junkie


The url you want is the top one it provides you with, the Direct Link.

Index Junkie


Just paste it into your image tag, like so:

<img src="http://indexjunkie.com/images/7rdo381c84t3fly43xec.gif">

Then paste the image tag into your page.




o Other Image Hosts

Most other image hosts work similarly to the ones above. You can generally find the url you want by looking for the one that starts with "http://" and ends with some image extension- usually .jpg, .gif or .png. Its often called the link, url, or direct link. You want to avoid any code that includes BBCode (that is codes in square tags like this [img]http://blah.gif[/img]) because BBCode doesn't work on VF. If you copy HTML tags off these sites they will work, but they usually make your image a clickable link back to that hosting site. If you don't want that to happen its better to create your own image tag by pasting the plain url into an image tag.

<img src="http://IMAGE URL.gif">


Other free image hosts include:





Design by [ KineticShock.com ] && [ PrintedExistence[dot]com ]
All content copyright © PrintedExistence 2006 - 2008


Contact VFLayouts
[ Contact VFLayouts! ]