How to implement parallax scrolling with jQuery

A parallax effect is adds a nice touch of style to an existing website, and looks fantastic with large images. Here is how to implement a parallax on a background image with jQuery. First, set the element’s background to fixed: .myElement{background:url(‘images/myBackground.jpg’) no-repeat fixed center top} Next, put this in your $(document).ready() function. Do not forget […]

How to use different CSS styles depending on screen orientation

Most modern browsers support the orientation media attribute, which allows you to define specific styles for devices in portrait or landscape mode. This is especially useful when designing websites for mobile devices. Here is how you use the orientation media selectors: @media screen and (orientation:portrait) { /* Portrait styles */ } @media screen and (orientation:landscape) […]