Css
Css
Css
Main -> Container (Nav, Header, Footer)
-ID, single use can't be used again in the document and be overwritten, for
specific elements
#large-title {}
-ATTRIBUTE SELECTOR, used to target html elements that already contain attributes
or attribute values
<a href="" target>Learn More</a>, example selects all <a> elements with a target
attribute
a[target] { color:green; }
<a href="" target="_blank">Learn More</a>, example selects all <a> elements with a
target="_blank" attribute
a[target="_blank"] { color:green; }
"value"
-CHAINING, combine class selector with type selector, use comma to combine any
selector and more than 2
ul.red {}, .red h1 {}, <h1 class="red large"></h1> .red.large {}, h1, .red, p
-Centering content with max width, if the content is larger than the width due to
screen change, useful to center your
website in a browser window, <div class='outer'> <div class='inner'> Hello </div>
</div>
.outer { background: black; padding: 10px;} .inner { max-width: 900px; margin:
0 auto;}
-SPECIFITY is the order the broswer decides which css styles will be displayed
ID(#heading {}) > classes(.headline {}) > type(h1 {}, * {}),
adding more than one tag, class, or id to a css selector increases the specificity
.main p {} > p {}
-TEXT-ALIGN: left, right, center, justify(spaces out text to align with the right
and left side of the parent element)
-VISIBILITY: hidden: vs display: none; element with vh will not be visible, leaves
and takes up an empty space where it
is intended to be display, while dn element will be completely removed
FLEXBOX
display:
display: flex; elements are displayed from left to right (origin position is top
to bottom)