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 January 10th, 2012, 07:50 PM
Friend of Wrox
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default CSS ID selectors

I was reviewing your book on CSS. I was wondering when it comes to ID selectors like:
#hero
{
width 78%;
margin: 5px auto;
}

and

#hero p
{
padding-right: 0;
padding-left: 10px;
}

and then.....

#hero nav
{
width 396px;
height 75px;
}

They both look same but different. How are they alike and how are they different?
 
Old January 11th, 2012, 10:43 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The last two are similar, because they both refer to an element *within* an element with an id of hero. They are different because they refer to different type of elements. In the first case, it refers to a paragraph (p); in the second case to a (non-existent) element called nav.

Hope this helps,

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!
 
Old January 11th, 2012, 11:13 AM
Friend of Wrox
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default

Quote:
Originally Posted by Imar View Post
The last two are similar, because they both refer to an element *within* an element with an id of hero. They are different because they refer to different type of elements. In the first case, it refers to a paragraph (p); in the second case to a (non-existent) element called nav.

Hope this helps,

Imar

Yes the documentation that I am reading, if I am not mistaken I believe, the #hero and # hero p id selectors are being referred to as style rules. Is that the same as id selectors?

Thank you
 
Old January 11th, 2012, 01:03 PM
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,

Take a look at Page 71 for a full description of CSS terminology.

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
using type selectors with id not efficient mathieu BOOK: Beginning JavaScript and CSS Development with jQuery 2 February 25th, 2010 12:10 PM
Article: Using the jQuery Selectors API jminatel BOOK: Beginning JavaScript and CSS Development with jQuery 0 April 20th, 2009 11:58 AM
CSS3 Selectors m_norouzi CSS Cascading Style Sheets 1 November 4th, 2007 10:58 AM
Record Selectors Teqlump Access 2 December 28th, 2004 09:56 AM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM





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