Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2010, 04:57 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 2
Thanked 10 Times in 7 Posts
Default CSS Declaration Location Decision

Hi Imar,

I was reading chapter 15 and while going through the Try It Out where we moved the GridView Styles to a theme and used a CSS class for the styling I started thinking about one certain bit of CSS. I understand what the CSS is doing, but I am more interested in the reason for the placement of the rules.

Code:
.GridViewHeaderStyle th, .GridViewPagerStyle
{
  background-color: #BCD1FE;
  background-repeat: no-repeat;
  background-position: 0 5px;
  text-align: left;
}
To me it seems like the background-repeat and background-position declarations should be placed under the following selector:

Code:
.GridViewSortedAscendingHeaderStyle, .GridViewSortedDescendingHeaderStyle
{

}
because they both deal with those particular th elements. I understand that this is not a book on CSS, but I just was wondering if there is something that I am missing or if the decision was arbitrary, because it seems that it works either way - at least testing moving the properties worked on IE 8 and Firefox 3.6.8.


Thanks.
 
Old August 12th, 2010, 03:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Yes, you're right. GridViewSortedAscendingHeaderStyle and GridViewSortedDescendingHeaderStyle would have been more appropriate as they are applied to the sorted headers. However, since GridViewSortedDescendingHeaderStyle is applied to a <th> and .GridViewHeaderStyle th refers to the same <th>, the net effect is exactly the same.

Looks like I forgot to move that code when I introduced the sort styles.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
walbalooshi (August 15th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT decision Making javaguy1007 XSLT 1 April 7th, 2009 06:28 AM
Generic Image structure working design-time, how? jacob C# 3 March 6th, 2006 05:28 PM
design (css) doesn't fit in page gilgalbiblewheel CSS Cascading Style Sheets 1 February 25th, 2005 05:20 AM
Implementation Decision reckon ASP.NET 1.x and 2.0 Application Design 2 June 28th, 2004 11:04 AM
Design decision on class library projects? tkubaska BOOK: ASP.NET Website Programming Problem-Design-Solution 2 May 19th, 2004 11:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.