.fig8 {
border: 5px solid red;
border-bottom:none;
}
.fig9 {
border-bottom:none;
border: 10px dotted navy;
}
All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout.
box-sizing:content-box is the "default".
box-sizing:border-box is considered by most to be the 'better way'. border-box shrinks the width of the content area to account for padding/border/margin when width is set.
You can set a width to 100% and not worry about funny math.
CSS Margins add spacing around an element.
CSS Padding add spacing inside an element.
5px
applies 5 pixels to all 4 sides.5px 10px
applies 5px to top and bottom and applies 10px to left and right.5px 10px 15px 20px
How do we horizontally center align block content?
margin-right:auto; margin-left:auto;
Sets the specific height and width of a block element
The CSS display property is used to change the default rendering style of an element.
You can change any element to display any type.
See the Pen UA-ITR-CSS-Dispaly by Jon (@Middaugh) on CodePen.
Changes the default styling of UL
and OL
lists
list-style-type
- changes the icon/value used in the listlist-style-position
- changes the position of the list. Accepts inside and outsidelist-style-img
- changes bullets to image. Accepts none or a valid URLlist-style: type position img
See the Pen UA - ITR-list styles by Jon (@Middaugh) on CodePen.
You can leverage grouping selectors to share styles between multiple selectors. This can be done by adding a comma between each selector.
h1, h2, .header, #site-header{
color:#ff0000;
}
See the Pen UA-ITR-Group Selectors by Jon (@Middaugh) on CodePen.
Ctrl+Shift+I
(Windows) or Cmd+Opt+I
(Mac)Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif
0
#a00
#a5a5a5
main
, set its width to 600px and set the margins so that the content shifts to the center of the screen.ul
tagul
tagnav-link
and apply the following rules