Advertisement
bdbrown

Unique Header Image by Page

Jan 6th, 2015
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.06 KB | None | 0 0
  1. /* set header height and default background image */
  2. #header {
  3.   background: url(http://yoursite/wp-content/uploads/image1.jpg) no-repeat center top;
  4.   height: 400px; /* height and margins below are based on this value and need to be adjusted accordingly */
  5.   }
  6. /* push the header menu down */
  7. #header .pad {
  8.   height: 340px;
  9.   }
  10. /* reduce content margin to align with bottom of menu */
  11. #page {
  12.   margin-top: -11px;
  13.   }
  14.  
  15. /* media queries to accommodate above changes */
  16. @media only screen and (min-width: 720px) and (max-width: 960px) {
  17.   #header .pad {
  18.     height: 341px;
  19.   }
  20.   #page {
  21.     margin-top: 0;
  22.   }
  23. }
  24. @media only screen and (max-width: 719px) {
  25.   #header .pad {
  26.     height: 400px;
  27.   }
  28.   #page {
  29.     margin-top: 50px;
  30.   }
  31. }
  32.  
  33. /* home page header image */
  34. .home #header {
  35.   background: url(http://yoursite/wp-content/uploads/image2.jpg) no-repeat center top;
  36.   }
  37. /* another page header image; .page-id class from the body tag */
  38. .page-id-9 #header {
  39.   background: url(http://yoursite/wp-content/uploads/image3.jpg) no-repeat center top;
  40.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement