Author Topic: newbie HTML question  (Read 4170 times)

0 Members and 1 Guest are viewing this topic.

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
newbie HTML question
« 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?
GOREGASM!

Offline S-U-P-E-R

  • My Butt is Ready :reggie;
  • Score: -63
    • View Profile
    • oh my god
RE:newbie HTML question
« Reply #1 on: October 30, 2006, 12:24:26 AM »
Quote

img src="blah blah" border=0

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
RE: newbie HTML question
« Reply #2 on: October 30, 2006, 10:13:39 AM »
Aha!  It's so simple!  Thank you!
GOREGASM!

Offline wandering

  • BABY DAISY IS FREAKIN HAWT
  • Score: 3
    • View Profile
    • XXX FREE HOT WADAISY PICS
RE: newbie HTML question
« Reply #3 on: October 30, 2006, 12:08:14 PM »
I hope these images don't involve yaoi.
“...there are those who would...say, '...If I could just not have to work everyday...that would be the most wonderful life in the world.' They don't know life. Because what makes life mean something is purpose.  The battle. The struggle.  Even if you don't win it.” - Richard M. Nixon

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
RE: newbie HTML question
« Reply #4 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.
GOREGASM!

Offline bustin98

  • Bustin' out kids
  • Score: 30
    • View Profile
    • Web Design Web Hosting Computer Sales and Service
RE:newbie HTML question
« Reply #5 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.

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
RE:newbie HTML question
« Reply #6 on: October 31, 2006, 06:29:48 PM »
I don't know what you're talking about.
GOREGASM!

Offline bustin98

  • Bustin' out kids
  • Score: 30
    • View Profile
    • Web Design Web Hosting Computer Sales and Service
RE:newbie HTML question
« Reply #7 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:

<!DOCTYPE ...>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>

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.

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
RE: newbie HTML question
« Reply #8 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
GOREGASM!

Offline bustin98

  • Bustin' out kids
  • Score: 30
    • View Profile
    • Web Design Web Hosting Computer Sales and Service
RE:newbie HTML question
« Reply #9 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');

for(j=0;j< thumbArray.length;j++) document.write("<a href=\"images/" + linkArray[j] + "\"><img src=\"images/" + thumbArray[j] + "\" width=\"100\" class=\"thumb\" />[/url]";

-->
</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">
<!--

for(j=1;j < 26;j++) document.write("<a href=\"images/" + j + "_lg.jpg\"><img src=\"images/" + j + ".jpg\" class=\"thumb\" />[/url]";

-->
</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
 

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
RE: newbie HTML question
« Reply #10 on: November 01, 2006, 01:03:03 PM »
Variable definitions without explicit type specifications?  Madness!
GOREGASM!

Offline bustin98

  • Bustin' out kids
  • Score: 30
    • View Profile
    • Web Design Web Hosting Computer Sales and Service
RE:newbie HTML question
« Reply #11 on: November 01, 2006, 02:17:29 PM »
Aww, you caught it. :P

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
RE: newbie HTML question
« Reply #12 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.
GOREGASM!

Offline bustin98

  • Bustin' out kids
  • Score: 30
    • View Profile
    • Web Design Web Hosting Computer Sales and Service
RE:newbie HTML question
« Reply #13 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.

Offline Smoke39

  • Smoking is only bad for you if you're not made of smoke already
  • Score: 3
    • View Profile
RE:newbie HTML question
« Reply #14 on: November 01, 2006, 07:27:33 PM »
My awesomeful website page can be found at this location.
GOREGASM!