Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp:image has borders that I can't get rid of

Status
Not open for further replies.

Hokkie

MIS
Nov 21, 2001
77
NL
Hi,

I have a asp:image control in one of my user controls and it loads a source depending on the page it is on. The image control is in a table cell, in a single-row table that has its width set to 950. The source of the image control is also always 950 pixels wide.

Whatever I try, asp.net seems to put a 4px border (margin) around the asp:image control on all sides. I've set every imaginable padding and margin attribute to 0 for the table, the row and the cell, but I still get this border. Am I missing something obvious?

Here is the code I use in my user control:

Code:
<table id="Table1" height="70" cellSpacing="0" cellPadding="0" width="950" border="0">
	<tr style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-TOP-STYLE: none; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none">
		<td align="left" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-TOP-STYLE: none; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" valign="top" width="950" height="70">
<asp:image id="Image1" ImageAlign="Right" Height="70" Width="950" runat="server" BorderWidth="0px" BorderStyle="None"></asp:image>
		</td>
	</tr>
</table>

As you can see, I can't think of any other attribute or property that I should set to 0 to get rid of the unwanted, 4px wide borders.

Can anybody help please? TIA.

Hokkie

 
move the css into style blocks/seperate files and use classes to define the layout.

does this happen in all bowsers, or just a specific browser? this is a CSS issue so you may want to try forum215

why would you have a table with 1 row/cell? if that's the case just place an image tag on the page. i think css is case sensative.

your final output would look something like this
Code:
<style>
	.tbl {
		height:70px;
		width:950px;
		border:0px;
	}
	.tbl tr td {
		padding:0px;
		margin:0px;
	}
	.tbl tr td img {
		border:0px;
		padding:0px;
		margin:0px;
		height:70px;
		width:950px;
		align:right;
	}
</style>
<table class="tbl">
	<tr>
		<td><img src="myfile.jpg" /></td>
	</tr>
</table>

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks everyone, I will try and sort out the css. It's a legacy application that has half a dozen css files but I guess I was looking for ways to avoid having to plow through all of them...

Hokkie

 
The problem was, indeed, a css style that put a 5px margin around all pictures, hidden away somewhere in a css file. Thanks everyone for their effort.

Hokkie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top