Centering a div horizontally
It will make the inner element center horizontally and it works without setting a specific width.
Working example here:
#inner {
display: table;
margin: 0 auto;
}
<div id="outer" style="width:100%">
<div id="inner">Foo foo</div>
</div>
Source:
http://stackoverflow.com/a/114549
http://stackoverflow.com/questions/114543/horizontally-center-a-div-in-a-div?rq=1
Freezing a tooltip (popup or modal) to edit CSS in Developer Tools window
To freeze a popover while shown or a modal window or a tooltip in hover state, or any other element that appears in hover state:
- F12 - to open a console.
- Hover over the element, the tooltip will appear.
- Alt+TAB to switch to the "Developet Tools" window.
- Go to Sources and press F8 there. The current state will freeze.
- Return to the tooltip and work with CSS.
Остановить кеширование CSS в WP
http://habrahabr.ru/post/163871/#comment_5637749
Чтобы обойти кеширование и в то же время иметь версию в имени файла придумано достаточно изящное решение в .htaccess
# анти-прокси-кэширование стилей
# style.v123.css -> style.css
RewriteRule ^(.*)∖.v[0-9]+∖.css$ $1.css
RewriteRule ^(.*)∖.v[0-9]+∖.js$ $1.js
* * *
Другой вариант противостояния кешированию. В строке подключения css файла, в атрибуте href после имени файла пишем “?v=версия_файла”.
Пример:
<link rel="stylesheet" media="all" href="..css/style.css?v=1" />
Браузер запоминает этот параметр, и проверяет его при каждом посещении сайта. Если версия файла изменится, стили перезагружаются.
P.S.
Кажется, этот метод не работает. Ищем другой.
Вот ещё два решения:
1.
http://charliepark.tumblr.com/post/5998700883/cache-busting-the-wordpress-stylesheet
"So, I just add a timestamp to the end of the CSS file … exactly how Rails (up to 3.1) did.
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>?<?php echo time(); ?>" />
By adding the last part of that string (?<?php echo time(); ?>), it means that the CSS file is fetched new on each pageload."
2.
http://wordpress.stackexchange.com/questions/5116/cache-busting-css-files-other-than-style-css
(Последний метод, внизу, вроде, доступен.)
Move sidebar to the left in Twenty Twelve, WP 3.5
http://wordpress.org/support/topic/move-main-sidebar-in-twen ty-twelve
Twenty Twelve, default theme in WP 3.5.
This code moves sidebar to the left.
Child theme CSS.
--
/*-- move sidebar to the left --*/
@media screen and (min-width: 600px) {
.site-content {
float: right;
}
.widget-area {
float: left;
}
}
/* for IE8 and IE7 ----------------*/
.ie .site-content {
float: right;
}
.ie .widget-area {
float: left;
}
CSS correction for Yandex Maps for WP to work
/* Yandex Maps Plugin
----------------------------------- */
table.YMaps-b-balloon-frame,
table.YMaps-b-balloon-frame tr,
table.YMaps-b-balloon-frame td {
margin: 0;
padding: 0;
border: none;
}
/*
#YMapsID img {
max-width: none;
}
*/
"if ie6" in Thematic child theme
add this to your child's functions.php:
function add_conditional(){ ?>
<!--[if IE]-->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory');?>/all-ie-only.css" />
<!--[endif]-->
<?}
add_action('wp_head','add_conditional');