Приемы CSS

Статья последний раз была обновлена 25.07.2023

Вертикальное выравнивание:

margin-top: -2px;
margin-bottom: -2px;

Интересный прием выстраивания подписей и полей ввода в форме:

#fast_order_form .fast_order_left {display: inline-block; width: 29%; text-align: right;}
#fast_order_form .fast_order_right {float: right; display: inline-block; width: 68%; text-align: left;}

Удалить ссылку через CSS (на примере лишнего элемента облака тегов):

.tagcloud > a[href*="/evernote/"] {
	display: none;
}

Прилипающий футер:

Header block

Main content

* {
	margin: 0;
}
html, body {
	height: 100%;
}
.wrapper {
	min-height: 100%;
	height: auto !important;
	height: 100%;
	margin-bottom: -80px; /* Отрицательное значение высоты footer'а */
}
.footer, .push {
	height: 80px; /* .footer и .push должны быть одинаковой высоты */
	clear: both;
}
kupereal

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *