Community Forums => General Chat => Topic started by: Smoke39 on October 29, 2006, 11:06:30 PM
Title: newbie HTML question
Post by: Smoke39 on October 29, 2006, 11:06:30 PM
By using "a href" and "img src" tags, I can make images that link to places. But they get frames around them with the link colors I defined. This causes me dishappiness. Is there a simple way to get this functionality without the dumb frames around my pictures?
Title: RE:newbie HTML question
Post by: S-U-P-E-R on October 30, 2006, 12:24:26 AM
Quote img src="blah blah" border=0
Title: RE: newbie HTML question
Post by: Smoke39 on October 30, 2006, 10:13:39 AM
Aha! It's so simple! Thank you!
Title: RE: newbie HTML question
Post by: wandering on October 30, 2006, 12:08:14 PM
I hope these images don't involve yaoi.
Title: RE: newbie HTML question
Post by: Smoke39 on October 30, 2006, 12:41:35 PM
No, but that's not a bad idea. Maybe I should add to my site a section for sexyful things.
Title: RE:newbie HTML question
Post by: bustin98 on October 31, 2006, 05:28:14 PM
If you have a number of image links, you can use a style sheet. Usually an external file, you can add it to the <head> section:
<style type="text/css"> <!--
img {border: 0px;}
--> </style>
There is alot you can control using style sheets. Its makes formatting your pages a breeze and it allows your browser to render pages quicker than when using attributes.
Yes, I build websites for a living. Forgive me for answering a question already answered.
Title: RE:newbie HTML question
Post by: Smoke39 on October 31, 2006, 06:29:48 PM
I don't know what you're talking about.
Title: RE:newbie HTML question
Post by: bustin98 on November 01, 2006, 05:18:33 AM
When you look at the code of your site (where you can see your tags), every page needs the following tags:
Somewhere after the <title> and before the </head>, add what I wrote and whenever you use <a href=""><img src="" />[/url] you won't need to add 'border="0"'.
Thats all. If you Google 'Cascading Style Sheet' (if you're so inclined) you'll see what else can be done with this wonderful tool.
Title: RE: newbie HTML question
Post by: Smoke39 on November 01, 2006, 08:37:58 AM
Oh. That might not be a bad idea, particularly for the art section, which has a bunch of thumbnails that link to their full images.
Speaking of thumbnails, got any clever ways to clamp one of the dimensions of an image and have it automatically scale the other dimension by the same percentage? :b
Title: RE:newbie HTML question
Post by: bustin98 on November 01, 2006, 09:49:01 AM
Well, I wouldn't scale images by percent, but you could specify a width and let the browser figure out the height on its own. Or the other way around, specify the height and leave open the width.
Here's a clever thing to do with CSS and Javascript:
In the head put this: <style type="text/css"> <!-- img {border: 0px;} img.thumb {display: block; float: left; margin: 5px;} --> </style> And in the body where you want to put your thumbs put this: <script language="javascript" type="text/javascript"> <!-- thumbArray = new Array('thumb1.jpg','thumb2.jpg'); linkArray = new Array('link1.jpg','link2.jpg');
--> </script> This creates a group that the script loops through and places each object of the group in a spot that corresponds with the number of the loop.
You can forgo the javascript and just use the CSS to set the width or height of the thumbs. The important parts are you need to specify "class='thumb'" in the <img> tag and you need to add "width: 100px;" or "height: 100px" to the CSS line "img.thumb".
You can also make the Javascript easier by naming the thumbnails and larger images a number: 1.jpg & 1_lg.jpg for example. Then if you have 25 images you can do this: <script language="javascript" type="text/javascript"> <!--
--> </script> And you don't need to mess with the arrays.
I gave you some options, and if it helps, terrific. If you get lost, I'd say thats to be expected
Title: RE: newbie HTML question
Post by: Smoke39 on November 01, 2006, 01:03:03 PM
Variable definitions without explicit type specifications? Madness!
Title: RE:newbie HTML question
Post by: bustin98 on November 01, 2006, 02:17:29 PM
Aww, you caught it. :P
Title: RE: newbie HTML question
Post by: Smoke39 on November 01, 2006, 04:59:12 PM
So can you actually do that? I've programmed in Java before, but not embeded like that.
Title: RE:newbie HTML question
Post by: bustin98 on November 01, 2006, 05:29:33 PM
Yeah, javascript and java have nothing other than the name in common.
Really the only web based programming language that wants variables defined is ASP, but even then its not required.
Javascript can be setup as a function in the <head>, embeded as I did in the example, or used as an external file and called from the page.
Best practice says to declare your variables and comment your code. I'll comment the complicated stuff, but not everything. And I rarely declare variables. I do if there's a chance that an outcome produces a result that doesn't define the variable and a script is looking for it later on.
So, now that I've got you going on the right path, what is the address of your site? I won't make any judgements, just curious.
Title: RE:newbie HTML question
Post by: Smoke39 on November 01, 2006, 07:27:33 PM
My awesomeful website page can be found at this location.