How can I prevent spaces between <a> tags being rendered?
- From: "mark4asp" <mark4asp@xxxxxxxxx>
- Date: 18 Feb 2008 12:28:50 GMT
How can I prevent spaces between <a> tags being rendered?
I've noticed that the asp.net CSS-Friendly GridView (e.g. with an
id="gvAwarded") is rendering html like this:
<div class="AspNet-GridView-Pagination AspNet-GridView-Bottom">
<span>1</span>
<a href="javascript:__doPostBack('gvAwarded','Page$2')">2</a>
<a href="javascript:__doPostBack('gvAwarded','Page$3')">3</a>
<a href="javascript:__doPostBack('gvAwarded','Page$11')">...</a>
<a
href="javascript:__doPostBack('gvAwarded','Page$Last')">>></a>
</div>
I would prefer to creat the following html:
<div id="gvAwardedPager" class="AspNet-GridView-Pagination
AspNet-GridView-Bottom">
<span>1</span><a
href="javascript:__doPostBack('gvAwarded','Page$2')">2</a><a
href="javascript:__doPostBack('gvAwarded','Page$11')">...</a><a
href="javascript:__doPostBack('gvAwarded','Page$Last')">>></a>
</div>
Why do browsers (FireFox and IE6) render the white space between the
<a> tags and how can I stop it? - short or rewriting the asp.net
GridView rendering code.
PS: This really is a pure CSS question as it relates to why I need to
remove whitespace between a list of <a> tags. I don't expect any
comments on asp.net because it's really nothing to do with the
fundamentals of this question (I will ask about modifying the asp.net
code elsewhere if I get no satisfaction here). The problem is with the
browsers.
Here are my styles (these class names are automatically rendered by the
aforementioned asp.net GridView.)
..AspNet-GridView-Bottom {margin:0;}
..AspNet-GridView-Pagination
{
font-family: Arial, Helvetica, sans-serif;
text-decoration: none;
font-size: 0.65em;
line-height: 19px;
}
..AspNet-GridView-Pagination a
{
margin:0;
display:inline;
border-collapse:collapse;
color: #555;
border-right: 1px solid #c5c5c5;
width: 3em;
text-align:center;
padding: 4px 6px 2px;
}
..AspNet-GridView-Pagination span
{
background-color: #CCC;
margin:0;
color: #000;
font-weight:bold;
border-top: 1px solid #CCC;
border-right: 1px solid #c5c5c5;
width: 3em;
text-align:center;
padding: 4px 6px 2px;
}
..AspNet-GridView-Pagination a:hover
{
color: #333;
background-color: #efefef;
border-top: 1px solid #c5c5c5;
}
.
- Follow-Ups:
- Re: How can I prevent spaces between <a> tags being rendered?
- From: C A Upsdell
- Re: How can I prevent spaces between <a> tags being rendered?
- From: Jeff
- Re: How can I prevent spaces between <a> tags being rendered?
- From: Stan Brown
- Re: How can I prevent spaces between <a> tags being rendered?
- From: Ben C
- Re: How can I prevent spaces between <a> tags being rendered?
- From: Andy Dingley
- Re: How can I prevent spaces between <a> tags being rendered?
- From: Harlan Messinger
- Re: How can I prevent spaces between <a> tags being rendered?
- From: mark4asp
- Re: How can I prevent spaces between <a> tags being rendered?
- Prev by Date: Re: Frustrating Positioning Problem
- Next by Date: Re: How can I prevent spaces between <a> tags being rendered?
- Previous by thread: inheritance, classes, ids?
- Next by thread: Re: How can I prevent spaces between <a> tags being rendered?
- Index(es):
Relevant Pages
|