Jump to content

Archived

This topic is now archived and is closed to further replies.

mattachoo

Links and image borders

Recommended Posts

This is pissing me off so much.  I have a client who wants an image of the week.  No problem with that, but the border in IE doesn't come out right.  It is that stupid blue border.  Mozilla works fine. 

This is what I have so far:
[code]/* CSS Document */
body {
background-color: #000000;
}
.style2 {
font-size: 10px;
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
}
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
}
a {
font-size: 10px;
color: #FF0000;
}
a:link {
text-decoration: none;
color: #FF0000;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FF0000;
}

/*a.band:link img{border-color: #FF0000; border-width:2px ; border: solid;}
a.band:visited img{border-color: #990000; border-width:2px ; border: solid;}
a.band:hover img{border-color: #FF0000; border-width:2px ; border: solid;}
a.band:active img{border-color: #FF0000; border-width:2px ; border: solid;}*/

a.band img{border-width:2px ;border-style: solid;}[/code]

The commented stuff was me trying to figure out how to make it work.  This is how it is now, and it works in Mozilla, but not Internet Explorer. 

Here is the code in the PHP file (the .... stuff isn't in the file, I wrote that to show that I'm not showing you the whole file):
[code]
.....THE CSS STYLESHEET......
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
.....other code.....

.....now php code....
<?
  $imageq = mysql_query('SELECT * FROM `image_of_week` WHERE `id` = 1 LIMIT 0, 1') or die(mysql_error());

$row = mysql_fetch_row($imageq);

echo'
  <a class="band" href="'.$row[1].'" target="_blank"><img src="resize.php?id='.$row[1].'"><br>
      <br>
  CLICK FOR FULL IMAGE </a>';
 
  ?>
[/code]


Don't worry too much about the php code, that all works.  The resize.php simply resize the images width and height.  I'm so stuck right now.  Please help, thank you.

Share this post


Link to post
Share on other sites
you gotta set the border property to 0 in the image, and add the alternative text to make it XHTML valid tag
[code]
<img src="resize.php?id='.$row[1].'" border="0" alt="Alt text" />
[/code]

Share this post


Link to post
Share on other sites
Tried both of those, and neither worked in IE.

**EDIT**

God, this is so stupid, but I got it to work.


Curent Code:
[code]/* CSS Document */
body {
background-color: #000000;
}
.style2 {
font-size: 10px;
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
}
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
}
a {
font-size: 10px;
color: #FF0000;
}
a:link {
text-decoration: none;
color: #FF0000;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FF0000;
}

a.rollover img{border:2px solid  #FF0000;}
a.rollover:visited img{border:2px solid  #990000;}
a.rollover:hover img{border:2px solid  #FF0000;}
[/code]


[code]<?
  $imageq = mysql_query('SELECT * FROM `image_of_week` WHERE `id` = 1 LIMIT 0, 1') or die(mysql_error());

$row = mysql_fetch_row($imageq);

echo'
  <a class="rollover" href="'.$row[1].'" target="_blank"><img src="resize.php?id='.$row[1].'" border="0" alt="Image of the Week" /><br>
      <br>
  CLICK FOR FULL IMAGE </a>';
 
  ?>[/code]

Stupid IE

Share this post


Link to post
Share on other sites
I'm curious about something here:
[code]a.band img{border-width:2px ;border-style: solid;}[/code]
Why is there no border-color: attribute?

Share this post


Link to post
Share on other sites
I like the shorthand, saves typing and bandwidth (if that even counts!)

.className{border:solid 1px red;}

or

.className{border-right:solid 1px #FF0000;}

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.