.btn {
background-color: #00bfff;
color: #ffffff;
border-radius: 10px;
padding: 1.5rem;
}
.btn--active:hover {
cursor: pointer;
transform: translateY(-0.25rem); /* Moves our button up/down on the Y axis */
}
hover
activates when the cursor goes over the selected element.Content Overflow
overflow
content property to an element if it’s inner contents are spilling over.overflow-x
: Apply horizontally.overflow-y
: Apply vertically.overflow
: Apply both directions.Defining Transitions
transition-property
: specifies the name of the CSS property to apply the transition.transition-duration
: during of the transition.transition-delay
: time before the transition should start.Examples :
#delay {
font-size: 14px;
transition-property: font-size;
transition-duration: 4s;
transition-delay: 2s;
}
#delay:hover {
font-size: 36px;
}
.box {
border-style: solid;
border-width: 1px;
display: block;
width: 100px;
height: 100px;
background-color: #0000ff;
transition: width 2s, height 2s, background-color 2s, transform 2s;
}
.box:hover {
background-color: #ffcccc;
width: 200px;
height: 200px;
transform: rotate(180deg);
}
block
, element
, modifier
.Block
Element
BEM Example
<form class="form form--theme-xmas form--simple">
<input class="form__input" type="text" />
<input class="form__submit form__submit--disabled" type="submit" />
</form>
/* block selector */
.form {
}
/* block modifier selector */
.form--theme-xmas {
}
/* block modifier selector */
.form--simple {
}
/* element selector */
.form__input {
}
/* element selector */
.form__submit {
}
/* element modifier selector */
.form__submit--disabled {
}