473,722 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS Font-size in DataGrid

I am having trouble with links in my DataGrid.

I have Links all over my page set to smaller and they are consistant all
over the page in both Mozilla and IE, except for the DataGrid.

Here is a snippet from my .css file:
*************** ************
body {
margin:0;
padding:0;
}
th {
background-color:#2FABAD;
color:white;
}
td {
font-size:smaller;
}
a {
font-size:smaller;
}
*************** *************** **************

I only have the font-size set in my "td" and "a" rules.

This makes everything work in both IE and Mozilla outside of the Datagrid
and the links are the same size in the Datagrid for Mozilla.

In IE, however the links always seem to be smaller than all the other links.
The text, however, is always the same size in both IE and Mozilla.

If I remove the "td" or "a", all the links get larger (as I would expect),
but in IE the links in the DataGrid is still smaller than the other links on
the page.

It is almost as if the Page is setting the links to smaller and the DataGrid
is setting smaller to the smaller size (doubling the smaller in essence) -
But only in IE.

What is causing this and how do I get around it?

Thanks,

Tom
Nov 18 '05 #1
4 3494
Tom, I played around a bit and couldn't duplicate your problem, but I do know
that relative sizes (e.g. "smaller" vs. "small") are always relative to the
parent element, not to some absolute, so I think a smaller <a> within a
smaller <td> is going to be "twice" as small (although I couldn't get this to
happen in IE6, which doesn't say much for the theory). Do you have the same
problem if you go with absolute sizes (e.g. 12px, small, etc.)?

Bill

"tshad" wrote:
I am having trouble with links in my DataGrid.

I have Links all over my page set to smaller and they are consistant all
over the page in both Mozilla and IE, except for the DataGrid.

Here is a snippet from my .css file:
*************** ************
body {
margin:0;
padding:0;
}
th {
background-color:#2FABAD;
color:white;
}
td {
font-size:smaller;
}
a {
font-size:smaller;
}
*************** *************** **************

I only have the font-size set in my "td" and "a" rules.

This makes everything work in both IE and Mozilla outside of the Datagrid
and the links are the same size in the Datagrid for Mozilla.

In IE, however the links always seem to be smaller than all the other links.
The text, however, is always the same size in both IE and Mozilla.

If I remove the "td" or "a", all the links get larger (as I would expect),
but in IE the links in the DataGrid is still smaller than the other links on
the page.

It is almost as if the Page is setting the links to smaller and the DataGrid
is setting smaller to the smaller size (doubling the smaller in essence) -
But only in IE.

What is causing this and how do I get around it?

Thanks,

Tom

Nov 18 '05 #2
"Bill Borg" <Bi******@discu ssions.microsof t.com> wrote in message
news:5C******** *************** ***********@mic rosoft.com...
Tom, I played around a bit and couldn't duplicate your problem, but I do
know
that relative sizes (e.g. "smaller" vs. "small") are always relative to
the
parent element, not to some absolute, so I think a smaller <a> within a
smaller <td> is going to be "twice" as small (although I couldn't get this
to
happen in IE6, which doesn't say much for the theory). Do you have the
same
problem if you go with absolute sizes (e.g. 12px, small, etc.)?
I'll have to play with it some more and get a small example to see if I can
recreate it and post it. I don't know about fixed sizes.

I know I am using IE6 and that is where it is happening

But I know I have other links on my screen (and they are all in TD's in some
form or another) that don't change and match Mozilla's size. Only inside of
my DataGrid are they a problem and only on IE.

Thanks,

Tom
Bill

"tshad" wrote:
I am having trouble with links in my DataGrid.

I have Links all over my page set to smaller and they are consistant all
over the page in both Mozilla and IE, except for the DataGrid.

Here is a snippet from my .css file:
*************** ************
body {
margin:0;
padding:0;
}
th {
background-color:#2FABAD;
color:white;
}
td {
font-size:smaller;
}
a {
font-size:smaller;
}
*************** *************** **************

I only have the font-size set in my "td" and "a" rules.

This makes everything work in both IE and Mozilla outside of the Datagrid
and the links are the same size in the Datagrid for Mozilla.

In IE, however the links always seem to be smaller than all the other
links.
The text, however, is always the same size in both IE and Mozilla.

If I remove the "td" or "a", all the links get larger (as I would
expect),
but in IE the links in the DataGrid is still smaller than the other links
on
the page.

It is almost as if the Page is setting the links to smaller and the
DataGrid
is setting smaller to the smaller size (doubling the smaller in
essence) -
But only in IE.

What is causing this and how do I get around it?

Thanks,

Tom

Nov 18 '05 #3
To style elements within a data grid, you can specifically add rules
using the following kind of syntax.
.DataSetClassNa me a{
//specific style for links in the datagrid
}
.DataSetClassNa me a:hover{
//specific style for hovered links in the dataset
}

Nov 18 '05 #4
Ok. Here is the scenario. I found out what has been happening, but not
why.

Apparently, if you have a Datagrid with no "Font-size=smaller", IE and
Mozilla act the same (whether or not you have a style a {smaller}.

If you now add "Font-size=smaller", IE will get smaller but Mozilla will
ignore it. Mozilla doesn't ignore the other font styles, such as
"Font-name" - only "Font-Size".

Then if you have a style a {smaller} and "font-size=smaller" it is additive.
It will take the smaller from the "style a" and than will make it even
smaller from the "font-size" in the DataGrid.

This does not happen in Mozilla since it ignores the "font-size in the
DataGrid"

Which is correct?

Here are 3 files that show the behavior

1st: no font-smaller or style a{smaller}
*************** *************** *************** *************** *************** *************** **
<%@ Page Language="VB" Debug="true" ContentType="te xt/html"
ResponseEncodin g="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<%@ Import Namespace="Syst em.Collections" %>
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>
<script runat="server">
Function CreateDataSourc e() As ICollection

Dim dt As DataTable
Dim dr As DataRow
Dim i As Integer

'create a DataTable
dt = New DataTable()
dt.Columns.Add( New DataColumn("Str ingValue", GetType(String) ))
dt.Columns.Add( New DataColumn("Boo lValue", GetType(Boolean )))
dt.Columns.Add( New DataColumn("Cur rencyValue", GetType(Double) ))

'Make some rows and put some sample data in
For i = 1 To 5
dr = dt.NewRow()
dr(0) = "Item " + i.ToString()
If (i Mod 2 <> 0) Then
dr(1) = True
Else
dr(1) = False
End If
dr(2) = 1.23 * (i + 1)
'add the row to the datatable
dt.Rows.Add(dr)
Next

'return a DataView to the DataTable
CreateDataSourc e = New DataView(dt)

End Function

Sub Page_Load(sende r as Object, e as EventArgs)

if not IsPostBack then
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
end if
End Sub

Private Sub DataGrid4_ItemD ataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs)

trace.warn("in itemdatabound")
Select Case e.Item.ItemType
Case ListItemType.It em, ListItemType.Al ternatingItem
Dim editButton As LinkButton = New LinkButton()
editButton = CType(e.Item.Ce lls(0).Controls (0), LinkButton)
editButton.Attr ibutes.Add("nam e", "#" & editButton.Uniq ueID)

Case ListItemType.Ed itItem
Dim UpdateButton As LinkButton = New LinkButton()
UpdateButton = CType(e.Item.Ce lls(0).Controls (0),
LinkButton)
UpdateButton.At tributes.Add("n ame", "#" &
UpdateButton.Un iqueID)
End Select
End Sub

Private Sub DataGrid1_ItemD ataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs)

trace.warn("in itemdatabound")
Select Case e.Item.ItemType
Case ListItemType.It em, ListItemType.Al ternatingItem
Dim editButton As LinkButton = New LinkButton()
editButton = CType(e.Item.Ce lls(0).Controls (0), LinkButton)
editButton.Attr ibutes.Add("nam e", "#" & editButton.Uniq ueID)

Case ListItemType.Ed itItem
Dim UpdateButton As LinkButton = New LinkButton()
UpdateButton = CType(e.Item.Ce lls(0).Controls (0),
LinkButton)
UpdateButton.At tributes.Add("n ame", "#" &
UpdateButton.Un iqueID)
End Select
End Sub

Private Sub DataGrid4_EditC ommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
trace.warn("in editCommand")
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub

Private Sub DataGrid4_Cance lCommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
trace.warn("in cancelCommand")
DataGrid4.EditI temIndex = -1
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub

Private Sub DataGrid4_Updat eCommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
DataGrid4.EditI temIndex = -1
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>View Positions</title>
<style type="text/css">
body {
margin:0;
padding:0;
}
</style>
</head>
<body>
<form method="post" name="form1" class="BodyText " runat="server">
<div align="left"><a href="addPositi ons.aspx">Add New Positions</a></div>
<p>
<asp:DataGrid id="DataGrid4" runat="server" BorderColor="#C C9966"
BorderStyle="No ne" BorderWidth="1p x" BackColor="Whit e" CellPadding="4"
onItemDataBound ="DataGrid4_Ite mDataBound"
onEditCommand=" DataGrid4_EditC ommand"
onUpdateCommand ="DataGrid4_Upd ateCommand"
onCancelCommand ="DataGrid4_Can celCommand">
<HeaderStyle HorizontalAlign ="center" BackColor="#c0e dee"
ForeColor="#2FA BAD" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true"/>
<ItemStyle BackColor="#F2F 2F2" Font-Name="Verdana, Arial, Helvetica,
sans-serif"/>
<AlternatingIte mStyle BackColor="#E5E 5E5" Font-Name="Verdana, Arial,
Helvetica, sans-serif" />
<FooterStyle HorizontalAlign ="center" BackColor="#E8E BFD"
ForeColor="#3D3 DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true"/>
<PagerStyle BackColor="whit e" Font-Name="Verdana, Arial, Helvetica,
sans-serif" />
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton"
UpdateText="Upd ate"
CancelText="Can cel"
EditText="Edit" >
</asp:EditCommand Column>
</Columns>

<PagerStyle HorizontalAlign ="Center" ForeColor="#330 099"
BackColor="#FFF FCC">
</PagerStyle>
</asp:DataGrid><b r>
</form>
</body>
</html>
*************** *************** *************** *************** *************** **
Both IE and Mozilla are identical

2nd: adding the font-size=smaller to the DataGrid
*************** *************** *************** *************** *************** ****
<%@ Page Language="VB" Debug="true" ContentType="te xt/html"
ResponseEncodin g="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<%@ Import Namespace="Syst em.Collections" %>
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>
<script runat="server">
Function CreateDataSourc e() As ICollection

Dim dt As DataTable
Dim dr As DataRow
Dim i As Integer

'create a DataTable
dt = New DataTable()
dt.Columns.Add( New DataColumn("Str ingValue", GetType(String) ))
dt.Columns.Add( New DataColumn("Boo lValue", GetType(Boolean )))
dt.Columns.Add( New DataColumn("Cur rencyValue", GetType(Double) ))

'Make some rows and put some sample data in
For i = 1 To 5
dr = dt.NewRow()
dr(0) = "Item " + i.ToString()
If (i Mod 2 <> 0) Then
dr(1) = True
Else
dr(1) = False
End If
dr(2) = 1.23 * (i + 1)
'add the row to the datatable
dt.Rows.Add(dr)
Next

'return a DataView to the DataTable
CreateDataSourc e = New DataView(dt)

End Function

Sub Page_Load(sende r as Object, e as EventArgs)

if not IsPostBack then
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
end if
End Sub

Private Sub DataGrid4_ItemD ataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs)

trace.warn("in itemdatabound")
Select Case e.Item.ItemType
Case ListItemType.It em, ListItemType.Al ternatingItem
Dim editButton As LinkButton = New LinkButton()
editButton = CType(e.Item.Ce lls(0).Controls (0), LinkButton)
editButton.Attr ibutes.Add("nam e", "#" & editButton.Uniq ueID)

Case ListItemType.Ed itItem
Dim UpdateButton As LinkButton = New LinkButton()
UpdateButton = CType(e.Item.Ce lls(0).Controls (0),
LinkButton)
UpdateButton.At tributes.Add("n ame", "#" &
UpdateButton.Un iqueID)
End Select
End Sub

Private Sub DataGrid1_ItemD ataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs)

trace.warn("in itemdatabound")
Select Case e.Item.ItemType
Case ListItemType.It em, ListItemType.Al ternatingItem
Dim editButton As LinkButton = New LinkButton()
editButton = CType(e.Item.Ce lls(0).Controls (0), LinkButton)
editButton.Attr ibutes.Add("nam e", "#" & editButton.Uniq ueID)

Case ListItemType.Ed itItem
Dim UpdateButton As LinkButton = New LinkButton()
UpdateButton = CType(e.Item.Ce lls(0).Controls (0),
LinkButton)
UpdateButton.At tributes.Add("n ame", "#" &
UpdateButton.Un iqueID)
End Select
End Sub

Private Sub DataGrid4_EditC ommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
trace.warn("in editCommand")
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub

Private Sub DataGrid4_Cance lCommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
trace.warn("in cancelCommand")
DataGrid4.EditI temIndex = -1
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub

Private Sub DataGrid4_Updat eCommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
DataGrid4.EditI temIndex = -1
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>View Positions</title>
<style type="text/css">
body {
margin:0;
padding:0;
}
</style>
</head>
<body>
<form method="post" name="form1" class="BodyText " runat="server">
<div align="left"><a href="addPositi ons.aspx">Add New Positions</a></div>
<p>
<asp:DataGrid id="DataGrid4" runat="server" BorderColor="#C C9966"
BorderStyle="No ne" BorderWidth="1p x" BackColor="Whit e" CellPadding="4"
onItemDataBound ="DataGrid4_Ite mDataBound"
onEditCommand=" DataGrid4_EditC ommand"
onUpdateCommand ="DataGrid4_Upd ateCommand"
onCancelCommand ="DataGrid4_Can celCommand">
<HeaderStyle HorizontalAlign ="center" BackColor="#c0e dee"
ForeColor="#2FA BAD" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true" Font-Size="Smaller"/>
<ItemStyle BackColor="#F2F 2F2" Font-Name="Verdana, Arial, Helvetica,
sans-serif" Font-Size="Smaller"/>
<AlternatingIte mStyle BackColor="#E5E 5E5" Font-Name="Verdana, Arial,
Helvetica, sans-serif" Font-Size="Smaller"/>
<FooterStyle HorizontalAlign ="center" BackColor="#E8E BFD"
ForeColor="#3D3 DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true" Font-Size="Smaller"/>
<PagerStyle BackColor="whit e" Font-Name="Verdana, Arial, Helvetica,
sans-serif" />
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton"
UpdateText="Upd ate"
CancelText="Can cel"
EditText="Edit" >
</asp:EditCommand Column>
</Columns>

<PagerStyle HorizontalAlign ="Center" ForeColor="#330 099"
BackColor="#FFF FCC">
</PagerStyle>
</asp:DataGrid><b r>
</form>
</body>
</html>
*************** *************** *************** *************** *************** *******

Both Mozilla and IE should look the same, but smaller.

3rd: adding the style a {smaller}
*************** *************** *************** *************** *************** ********
<%@ Page Language="VB" Debug="true" ContentType="te xt/html"
ResponseEncodin g="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<%@ Import Namespace="Syst em.Collections" %>
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>
<script runat="server">
Function CreateDataSourc e() As ICollection

Dim dt As DataTable
Dim dr As DataRow
Dim i As Integer

'create a DataTable
dt = New DataTable()
dt.Columns.Add( New DataColumn("Str ingValue", GetType(String) ))
dt.Columns.Add( New DataColumn("Boo lValue", GetType(Boolean )))
dt.Columns.Add( New DataColumn("Cur rencyValue", GetType(Double) ))

'Make some rows and put some sample data in
For i = 1 To 5
dr = dt.NewRow()
dr(0) = "Item " + i.ToString()
If (i Mod 2 <> 0) Then
dr(1) = True
Else
dr(1) = False
End If
dr(2) = 1.23 * (i + 1)
'add the row to the datatable
dt.Rows.Add(dr)
Next

'return a DataView to the DataTable
CreateDataSourc e = New DataView(dt)

End Function

Sub Page_Load(sende r as Object, e as EventArgs)

if not IsPostBack then
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
end if
End Sub

Private Sub DataGrid4_ItemD ataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs)

trace.warn("in itemdatabound")
Select Case e.Item.ItemType
Case ListItemType.It em, ListItemType.Al ternatingItem
Dim editButton As LinkButton = New LinkButton()
editButton = CType(e.Item.Ce lls(0).Controls (0), LinkButton)
editButton.Attr ibutes.Add("nam e", "#" & editButton.Uniq ueID)

Case ListItemType.Ed itItem
Dim UpdateButton As LinkButton = New LinkButton()
UpdateButton = CType(e.Item.Ce lls(0).Controls (0),
LinkButton)
UpdateButton.At tributes.Add("n ame", "#" &
UpdateButton.Un iqueID)
End Select
End Sub

Private Sub DataGrid1_ItemD ataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs)

trace.warn("in itemdatabound")
Select Case e.Item.ItemType
Case ListItemType.It em, ListItemType.Al ternatingItem
Dim editButton As LinkButton = New LinkButton()
editButton = CType(e.Item.Ce lls(0).Controls (0), LinkButton)
editButton.Attr ibutes.Add("nam e", "#" & editButton.Uniq ueID)

Case ListItemType.Ed itItem
Dim UpdateButton As LinkButton = New LinkButton()
UpdateButton = CType(e.Item.Ce lls(0).Controls (0),
LinkButton)
UpdateButton.At tributes.Add("n ame", "#" &
UpdateButton.Un iqueID)
End Select
End Sub

Private Sub DataGrid4_EditC ommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
trace.warn("in editCommand")
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub

Private Sub DataGrid4_Cance lCommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
trace.warn("in cancelCommand")
DataGrid4.EditI temIndex = -1
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub

Private Sub DataGrid4_Updat eCommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
DataGrid4.EditI temIndex = -1
DataGrid4.DataS ource = CreateDataSourc e()
DataGrid4.DataB ind()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>View Positions</title>
<style type="text/css">
body {
margin:0;
padding:0;
}
a {
font-size:smaller;
}
</style>
</head>
<body>
<form method="post" name="form1" class="BodyText " runat="server">
<div align="left"><a href="addPositi ons.aspx">Add New Positions</a></div>
<p>
<asp:DataGrid id="DataGrid4" runat="server" BorderColor="#C C9966"
BorderStyle="No ne" BorderWidth="1p x" BackColor="Whit e" CellPadding="4"
onItemDataBound ="DataGrid4_Ite mDataBound"
onEditCommand=" DataGrid4_EditC ommand"
onUpdateCommand ="DataGrid4_Upd ateCommand"
onCancelCommand ="DataGrid4_Can celCommand">
<HeaderStyle HorizontalAlign ="center" BackColor="#c0e dee"
ForeColor="#2FA BAD" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true" Font-Size="Smaller"/>
<ItemStyle BackColor="#F2F 2F2" Font-Name="Verdana, Arial, Helvetica,
sans-serif" Font-Size="Smaller"/>
<AlternatingIte mStyle BackColor="#E5E 5E5" Font-Name="Verdana, Arial,
Helvetica, sans-serif" Font-Size="Smaller"/>
<FooterStyle HorizontalAlign ="center" BackColor="#E8E BFD"
ForeColor="#3D3 DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true" Font-Size="Smaller"/>
<PagerStyle BackColor="whit e" Font-Name="Verdana, Arial, Helvetica,
sans-serif" />
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton"
UpdateText="Upd ate"
CancelText="Can cel"
EditText="Edit" >
</asp:EditCommand Column>
</Columns>

<PagerStyle HorizontalAlign ="Center" ForeColor="#330 099"
BackColor="#FFF FCC">
</PagerStyle>
</asp:DataGrid><b r>
</form>
</body>
</html>
*************** *************** *************** *************** *************** ***

Here both IE and Mozilla get smaller (IE is smaller the Mozilla, because of
the previous setting of the font-size in the DataGrid)

Very confusing and time wasting.

The solutions seems to be to NEVER use font-size in the DataGrid if you
don't know what browser you are going to use. What I was finding that in IE
I was not able to see the link at all, it was so small.

BTW, Netscape works the same way as Mozilla.

Thanks,

Tom.
"tshad" <ts**********@f tsolutions.com> wrote in message
news:OR******** ******@TK2MSFTN GP14.phx.gbl...
"Bill Borg" <Bi******@discu ssions.microsof t.com> wrote in message
news:5C******** *************** ***********@mic rosoft.com...
Tom, I played around a bit and couldn't duplicate your problem, but I do
know
that relative sizes (e.g. "smaller" vs. "small") are always relative to
the
parent element, not to some absolute, so I think a smaller <a> within a
smaller <td> is going to be "twice" as small (although I couldn't get
this to
happen in IE6, which doesn't say much for the theory). Do you have the
same
problem if you go with absolute sizes (e.g. 12px, small, etc.)?


I'll have to play with it some more and get a small example to see if I
can recreate it and post it. I don't know about fixed sizes.

I know I am using IE6 and that is where it is happening

But I know I have other links on my screen (and they are all in TD's in
some form or another) that don't change and match Mozilla's size. Only
inside of my DataGrid are they a problem and only on IE.

Thanks,

Tom

Bill

"tshad" wrote:
I am having trouble with links in my DataGrid.

I have Links all over my page set to smaller and they are consistant all
over the page in both Mozilla and IE, except for the DataGrid.

Here is a snippet from my .css file:
*************** ************
body {
margin:0;
padding:0;
}
th {
background-color:#2FABAD;
color:white;
}
td {
font-size:smaller;
}
a {
font-size:smaller;
}
*************** *************** **************

I only have the font-size set in my "td" and "a" rules.

This makes everything work in both IE and Mozilla outside of the
Datagrid
and the links are the same size in the Datagrid for Mozilla.

In IE, however the links always seem to be smaller than all the other
links.
The text, however, is always the same size in both IE and Mozilla.

If I remove the "td" or "a", all the links get larger (as I would
expect),
but in IE the links in the DataGrid is still smaller than the other
links on
the page.

It is almost as if the Page is setting the links to smaller and the
DataGrid
is setting smaller to the smaller size (doubling the smaller in
essence) -
But only in IE.

What is causing this and how do I get around it?

Thanks,

Tom


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4184
by: Justin Van Patten | last post by:
Hello, I am having trouble converting a LOGFONT structure to a System.Drawing.Font object. I'm calling SystemParametersInfo to get the LOGFONT lfntSMCaptionFont from a NONCLIENTMETRICS structure. I seem to be doing this correctly, but when I try to create a System.Drawing.Font object with the Font.FromLogFont, the new Font object has a different Name than the LOGFONT.
10
4047
by: Richard R Plourde | last post by:
I've got a problem that IE doesn't seem to use the entire font unicode subgroups from a hinted font file. When I display the following web page in IE 6 as opposed to Firefox 1.0 PR. Check out the web page in question... http://clientserver.home.comcast.net/unicode.html If you examine, for a few examples, characters such as square root (&amp;#8730;), prime (&amp;#8242;) and double prime (&amp;#8243;).
3
7217
by: Barry Anderberg | last post by:
I'm using the .NET Memory Profiler by Sci Tech and I wrote a little test application to verify something odd I observed and it appears that System.Drawing.Font fails to dispose of its FontFamily. I run the following code: // BEGIN while( true ) { System.Drawing.Graphics dc=lblClock.CreateGraphics();
3
26565
by: Wim | last post by:
I would like to store the ListView font in the XML config file. So I have a string variable listFont that stores the font (font.ToString()). It must be a string variable because a Font object cannot be written to the XML config file. Next time the program is started the font is read from the config file. But how to convert the string to a Font object? -- Wim
3
3671
by: pnp | last post by:
I have created a coposite user control of a text box and a label. I have exposed the font of the textbox property through a property of the control but every time I try to change that through the property grid of the designer when I use the composite control in a form, after a rebuild the changes seem to get lost! I don't see the Font property anywhere in the inner code... What am I doing wrong?
4
1942
by: BobAchgill | last post by:
Is it possible to use a font that is not stored in the windows font directory? I would like to use a font that is stored in my application directory... But this does not seem to work... rtbMyRichTextBox.SelectionFont = New Font(CurDir() + "\" + "MyFont.ttf", 12, FontStyle.Bold) Thanks!
6
8095
by: BobAchgill | last post by:
Has anyone had success with writing text using a private font that was not already installed to the system? When I try the example code in NET Framework Developer's Guide called “Creating a Private Font Collection” .... I only see a default font written to the form NOT the private font that was loaded. Ofcourse I see the right font written if the font is already one that is installed in the system. But if the private font that I...
1
2722
by: Henry Jones | last post by:
I found some code to change the font on a button to bold: private void btnBold_Click(object sender, System.EventArgs e) { btnCalculate.Font = new Font(btnCalculate.Font, btnCalculate.Font.Style | FontStyle.Bold);
24
2835
by: Tony Girgenti | last post by:
Hello. Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a windows XP Pro, SP2. Before printing a document, i want to set the font to a font that is only available with the printer that i am printing to(Zebra TLP2844). When i open Word and look at the fonts available for the default printer, it does not show the fonts i want. If i cahnge the printer to the printer that
16
1876
by: carlbernardi | last post by:
Hi, I was wondering if there is way use a font that is somehow kept in the code instead of having to load it? I am working on a single script that so far can produce images and html but I have not been able to figure out a way that it can also produce a font. Thanks Carl
0
8739
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9383
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5995
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2601
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.