Questions Tags Users Unanswered

Override of min-height on special pages

Question is answered.
3 answers (2 voices) (19K views)
Hi,

I have set a min-height to the body of a site:
1.
2.
3.
#body{
    min-height: 730px;
}


Okay, for the standard three pages this is fine.

But can I set an override to that on a special page like blog?

And maybe also on articles that will be written on blog?

Thanks in advance.
3 Answers
Hi,

if you want to set a minimum height only on pages that use the Default Template:

1.
2.
3.
.page-template-default #body {
    min-height: 730px;
}


BTW, use min-height: auto; to turn off minimum height.
Thumbs up!! Thank You - webass -
So, in terms of only having it on the defaul template, which is used on the three now active pages, I would look for the css of the default_page there?

I mean I now have set min-height globally.

I thought up-side-down maybe, I could "turn" min-height off on sepcial pages.

Cause I cannot find a "default" in the documentation.

So. The "standard pages" now dont use a special page type , You know?

Simply default.
Hi Andre,

The page specific CSS classes are detailed in the Body CSS Classes Based On Page Types section in the theme documentation. You can also find examples there.

For example, if you want to set a minimum height on Blog pages:

1.
2.
3.
.page_blog #body {
    min-height: 800px;
}


To set the same minimum height on blog pages and posts:

1.
2.
3.
.page_blog #body, .single-post #body {
    min-height: 800px;
}



Since the post_type_blog CSS class is set on all blog related pages (blog pages, blog posts, blog date, category and tag pages), if you want to specify the same height on these pages:

1.
2.
3.
.post_type_blog #body {
    min-height: 800px;
}


If you need more information, please feel free to ask.
15 30 50 per page

Your Answer

Limit of files to attach: 3 / Max total size: 1024 KB
File:
Description:
remove