Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

id selector and hash mark

Featured Replies

I can not find any reference to this in my tutorial sources, I know the hash means an id selector and that the div is a block level selector. But I do not understand what is happening below (even though I am using firefox and the web developer to understand. If the hash is a block level selector and the div also - why are they together in this second paragraph?

 

 

 

#sidebar {

float: left;

width: 20%;

display: inline;

padding-bottom: 10px;

}

#sidebar div { padding: 20px; text-align: left; }

#content {

float: right;

width: 80%;

display: inline;

padding-bottom: 10px;

'#sidebar div' is selecting a div within a div called 'sidebar'. An equivalent selector would be 'div#sidebar div' but since '#'s are more specific than html elements most people use '#sidebar div'.

 

The space signifies more specificity. So if you wanted to target an anchor in a list that's in a div you could write '#Id ul li a.class' instead of 'a.class' which might refer to anchors used outside of '#Id'.

 

Probably could have explained that better! source

  • Author

'#sidebar div' is selecting a div within a div called 'sidebar'. An equivalent selector would be 'div#sidebar div' but since '#'s are more specific than html elements most people use '#sidebar div'.

 

The space signifies more specificity. So if you wanted to target an anchor in a list that's in a div you could write '#Id ul li a.class' instead of 'a.class' which might refer to anchors used outside of '#Id'.

 

Probably could have explained that better! source

 

Hi and thanks. Understood the first para, sorry not the second para, I do know what class is i think, but did'nt understand really what you meant (not your fault - it's mine), but yeh. anyway you explained it better than 'source'- bit of an elitist language methinks, bit like trying to learn a foreign language by teaching school kids poetry and imperfective verb parsing, the human being works not like this.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.