In the spirit of CSS itself, as the study of Cascading Style Sheets, we want to add an โonion layerโ on top of what we started doing back at CSS and HTML Complex Selectors Primer Tutorial as shown below, today. That โonion layerโ, in our โonions of the 4th dimensionโ feeling here, relates to HTML element attributes โฆ
Attributes provide additional information about HTML elements.
All HTML elements can have attributes
Attributes provide additional information about an element
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name=โvalueโ
Now, as you can imagine, there is no end to the level of (fine) granularity of โselectionโ this gives you as a tool, in relation to picking out really specific subsets of HTML (elements) for your CSS styling attention. Perhaps the most everyday HTML element with important โattributesโ that we can think of, is the HTML a tag, as a link to โsomewhereโ โฆ though โsomewhereโ can also be โnowhereโ โฆ chortle, chortle โฆ and todayโs work replaces the HTML p (child) element types of the previous tutorial and replaces them with HTML a (child) element types, for our purposes today.
If you clicked that last link youโd have seen a myriad of HTML a tag โattributeโ possibilities for you to think about โฆ at the time of writing, namely โฆ
- charset
- coords
- download
- href
- hreflang
- media
- name
- rel
- rev
- shape
- target
- type
โฆ which seems like a lot of scope for (fine granular selector) definition. However, this โattributeโ selection does not apply to inferred default values. In other words, if the default target=โ_selfโ is not actually written in your HTML for a given HTML a tag that you want to hone in on for particular styling, donโt expect CSS like a[target=โ_selfโ] { font-weight: bold; } to catch these, as this โattributeโ selector CSS only applies to specifically defined and โattributedโ HTML.
And so, today, we have links to โฆ
- Tutorial picture today, again, curiously, may be more useful to you than โฆ
- Live
run โฆ made up of โฆ
- HTML and CSS programming source code you could call complex_attribute_selectors
html (that got derived in thisway)
โฆ for your perusal, and thought. Once again, thanks to this wonderful inspiring link.
Did you know?
As you might suspect there is a โcontainsโ way to define โattributeโ selectors. Where we have, today โฆ
a[href="//www.rjmprogramming.com.au"]
โฆ we could widen its scope (of cover) via the โcontainsโ version โฆ
a[href*="rjmprogramming.com.au"]
โฆ to cover any URL from this domain.
Previous relevant CSS and HTML Complex Selectors Primer Tutorial is shown below.
Today, as with WordPress 4.1.1โs CSS and HTML Complex Selectors Primer Tutorial, we want to delve deeper into the less obvious aspects of CSS, encouraged as we were to find this wonderful inspiring link โฆ thanks. But hold off on the โbounceโ now, because we are value adding the wonderful information from the link with practical and self explanatory HTML and CSS web applications that all show โฆ
- CSS involved โฆ is inline CSS shown and available in the HTML programming source you can optionally download โฆ and โฆ
- HTML subset of relevance that the CSS acts on โฆ above โฆ
- The resultant HTML webpage result
โฆ all these three components on the one webpage, to help with โcause and effectโ regarding these more complex CSS concepts. Perhaps, that way, theyโll โsink inโ quite well?!
So what โComplex Selectorโ types are we trying to highlight in todayโs web application โฆ
- Direct Child โฆ child in parent/child relationship โฆ (Todayโs) eg. article > p { โฆ }
- General Sibling โฆ elements at the same hierarchical layer โฆ (Todayโs) eg. h2 ~ p { โฆ }
- Adjacent Sibling โฆ first elements at the same hierarchical layer โฆ (Todayโs) eg. h2 + p { โฆ }
Knowing about some of these more esoteric selectors could help you pinpoint specific elements within complex โcontainerโ elements, we hope you get out of todayโs work.
So this leaves us leaving you with links to โฆ
- Tutorial picture today, curiously, may be more useful to you than โฆ
- Live
run โฆ made up of โฆ
- HTML and CSS programming source code you could call complex_selectors
html
โฆ and weโll get back to you with more CSS of this ilk as time goes on.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.