CSS Intro & Specificity
CSS Specificity digest
CSS Intro
What Happens to CSS when we load up a web page?
Quick Review: CSS Terminology
CSS Specificity
Cascading Style Sheets and Specificity
The universal selector * has no specificity value (0, 0, 0, 0);
Text align and Vertical align
The text-align property in CSS is used to align the inner content of a block element.
-
Content is used here as as term instead of text, because while
text-aligncertainly affects text, it affects allinlineorinline-blockelements in that container(container will beblockelement such as paragraphs<p>...</p>, divs<div>...</div>, sections<section>...</section>, articles<article>...</article>, and so on..). -
This alignment affects the horizontal axis only. So the
text-alignproperty is different from thevertical-alignproperty which we use to set the vertical alignment of an element.
You can also use the vertical-align property to center inline, inline-block, or table cell elements vertically.
- One of the many applications for this approach is to vertically align an image with text or to vertically align the content of a table cell.
.element {
display: inline-block;
vertical-align: middle;
}
- This method(
vertical-align) not working with the block element, could be a deal breaker - 15 ways to implement vertical alignment with CSS - Log Rocket
Box Shadow
.package {
box-shadow: [horizontal offset] [vertical offset] [blur radius] [optional spread radius] [color];
box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}