Skip to content

Instantly share code, notes, and snippets.

View igorpronin's full-sized avatar

Igor Pronin igorpronin

View GitHub Profile
@igorpronin
igorpronin / html, css
Created August 15, 2015 14:39
HTML, CSS / Выравнивание элементов по центру по вертикали, горизонтали. Способ 2. Адаптив.
HTML
<div class="wrap">
<div class="content"> </div>
</div>
<div class="wrap">
<img src="http://lorempixel.com/200/200/sports/" width="200" height="200">
</div>
@igorpronin
igorpronin / html, css
Last active August 29, 2015 14:27
HTML, CSS / Выравнивание элементов по центру по вертикали, горизонтали. Способ 1. Древний.
Способ надежный, но для .wrap нельзя задать размеры в %. Плохо подходит для адаптива.
-----------
HTML
<div class="wrap">
<div class="content"> </div>
</div>
CSS
@igorpronin
igorpronin / html, css
Created August 15, 2015 13:50
HTML, CSS / Правильная верстка: ограничение изображения по размеру блока
HTML
<div class="wrap">
<img src="img/img.jpg">
</div>
CSS
.wrap {
width: 200px;
@igorpronin
igorpronin / js
Last active August 29, 2015 14:27
jQuery add / remove / change css class on click
$(".click_element").click(function() {
if ($(".target_element").is(".class_1")) {
$(".target_element").removeClass("class_1");
$(".target_element").addClass("class_2");
} else {
$(".target_element").removeClass("class_2");
$(".target_element").addClass("class_1");
}
});
@igorpronin
igorpronin / css
Last active August 29, 2015 14:27
Turn OFF Animate.css on Mobile Devices
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.animated {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
@igorpronin
igorpronin / css, js
Last active August 2, 2016 14:21
jQuery Page Preload
.loader {
background: none repeat scroll 0 0 #ffffff;
bottom: 0;
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 9999;